Hur gör man så att när man trycker på Command1 så ska datorn spara hela formen till en BMP fil som ligger i samma mapp? Här är ett exempel: Kan man inte printe formen till bmp på nåt sätt? Bara en fundering.Spara Formen till BMP Format
Språk: Vb6Sv: Spara Formen till BMP Format
<code>
Option Explicit
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Picture1.Move 0, 0, Width, Height
BitBlt Picture1.hDC, 0, 0, Width / Screen.TwipsPerPixelX, Height / Screen.TwipsPerPixelY, GetWindowDC(Me.hwnd), 0, 0, vbSrcCopy
Picture1.Refresh
SavePicture Picture1.Image, App.Path & "\Form1.bmp"
End Sub
Private Sub Form_Load()
Picture1.AutoRedraw = True
Picture1.Visible = False
Picture1.BorderStyle = vbBSNone
End Sub
</code>Sv: Spara Formen till BMP Format