|
使用这个图片模块时对图片大小要求,使用小图片时显示多个图。如何改为拉伸模式?
Option Compare Database
Private Const GCL_HBRBACKGROUND = -10
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function CreatePatternBrush Lib "gdi32" (ByVal hBitmap As Long) As Long
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, ByVal lpRect As Any, ByVal bErase As Long) As Long
Public Sub SetBackGround(wpv_Arg As Variant)
Dim wlo_Image As Object
Dim wlv_Brush As Long
Dim wlv_Hwnd As Long
If Not IsNumeric(wpv_Arg) Then
Set wlo_Image = LoadPicture(wpv_Arg)
wlv_Brush = CreatePatternBrush(wlo_Image.Handle)
Set wlo_Image = Nothing
Else
wlv_Brush = CreateSolidBrush(wpv_Arg)
End If
wlv_Hwnd = FindWindowEx(Application.hWndAccessApp, 0, "MDIClient", vbNullString)
SetClassLong wlv_Hwnd, GCL_HBRBACKGROUND, wlv_Brush
InvalidateRect wlv_Hwnd, vbNullString, 1
End Sub
|
|