Public 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 LongPublic Function FillBlt(frm As Object, Pic As Object) Dim i As Long, j As Long frm.ScaleMode = 3 frm.AutoRedraw = True Pic.AutoRedraw = True Pic.ScaleMode = 3 Pic.AutoSize = True For i = 0 To frm.ScaleWidth Step Pic.ScaleWidth For j = 0 To frm.ScaleHeight Step Pic.ScaleHeight BitBlt frm.hdc, i, j, Pic.ScaleWidth, Pic.ScaleHeight, Pic.hdc, 0, 0, vbSrcCopy Next j Next i frm.Refresh End Function
Dim i As Long, j As Long
frm.ScaleMode = 3
frm.AutoRedraw = True
Pic.AutoRedraw = True
Pic.ScaleMode = 3
Pic.AutoSize = True
For i = 0 To frm.ScaleWidth Step Pic.ScaleWidth
For j = 0 To frm.ScaleHeight Step Pic.ScaleHeight
BitBlt frm.hdc, i, j, Pic.ScaleWidth, Pic.ScaleHeight, Pic.hdc, 0, 0, vbSrcCopy
Next j
Next i
frm.Refresh
End Function
没什么比API更实在的了