1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| 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 Sub Command1_Click()
Picture1.PaintPicture Image1.Picture, 0, 0, Picture1.Width, Picture1.Height
Dim sDC As Long
Dim path1, path2 As String
path1 = "c:\image\test.bmp"
With Picture1
sDC = .hDC
BitBlt .hDC, 0, 0, .ScaleWidth, .ScaleHeight, sDC, 0, 0, vbSrcCopy
SavePicture .Image, path1
End With
End Sub |
Partager