' Make the image fit the MDI form.
Private Sub MDIForm_Resize()
Dim client_rect As RECT
Dim client_hwnd As Long
picStretched.Move 0, 0, _
ScaleWidth, ScaleHeight
' Copy the original picture into picStretched.
picStretched.PaintPicture _
picOriginal.Picture, _
0, 0, _
picStretched.ScaleWidth, _
picStretched.ScaleHeight, _
0, 0, _
picOriginal.ScaleWidth, _
picOriginal.ScaleHeight
' Set the MDI form's picture.
Picture = picStretched.Image
' Invalidate the picture.
client_hwnd = FindWindowEx(Me.hwnd, 0, "MDIClient", _
vbNullChar)
GetClientRect client_hwnd, client_rect
InvalidateRect client_hwnd, client_rect, 1
End Sub
|