To resize you just use StretchBlt.
I've posted numerous examples on the forums. Here's one too ;
VB Code:
' By Jamie Plenderleith
'
' This code will stretch the 'background' picture of a form to the size of the form
' Change the picDc = GeneradeDC(..) line to point to an appropriate graphic
'
Option Explicit
Private picDc As Long
Private picWidth As Long
Private picHeight As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Public Function GenerateDC(FileName As String) As Long
Dim DC As Long, picTemp As IPictureDisp
DC = CreateCompatibleDC(0)
If DC < 1 Then
Exit Function
End If
Set picTemp = LoadPicture(FileName)
picWidth = ScaleX(picTemp.Width)
picHeight = ScaleY(picTemp.Height)
SelectObject DC, picTemp
DeleteObject picTemp
Set picTemp = Nothing
GenerateDC = DC
End Function
Private Sub Form_Load()
ScaleMode = 3
picDc = GenerateDC("c:\jamie\barrk.bmp")
With Picture1
.AutoRedraw = True
.Move 0, 0, ScaleWidth, ScaleHeight
.ScaleMode = 3
End With
doStretch
End Sub
Private Function doStretch()
Debug.Print StretchBlt(Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, picDc, 0, 0, picWidth, picHeight, vbSrcCopy)
Picture1.Refresh
End Function
Private Sub Form_Resize()
Picture1.Move 0, 0, ScaleWidth, ScaleHeight
doStretch
End Sub