真正可以和photoshop一样填充
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function CreatePatternBrush Lib "gdi32" (ByVal hBitmap As Long) As Long
Private Declare Function FillRect Lib "user32" (ByVal hdc As Long, lpRect As rect, ByVal hbrush As Long) As Long
Dim hbrush As Long
Private Type rect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Dim rectForm As rect
Me.AutoRedraw = True
Picture1.Picture = LoadPicture("d:\1.bmp")
hbrush = CreatePatternBrush(Picture1.Picture)
SelectObject Me.hdc, hbrush
With rectForm
.Left = 0
.Top = 0
.Right = Me.ScaleWidth / Screen.TwipsPerPixelX
.Bottom = Me.ScaleHeight / Screen.TwipsPerPixelY
End With
FillRect Me.hdc, rectForm, hbrush
End Sub