Option Explicit ' Form1 add 1 picture frames Picture1 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 Lo Ng, ByVal nsrcwidth as Long, ByVal nsrcheight as Long, ByVal Dwrop as Long) as Long Private Declare Function Setstretchblt Mode Lib "GDI32" (ByVal hdc as Long, ByVal Nstretchmode as Long) as long private Const HALFTONE = 4 Private Const SRCCOPY = &hcc0020 ' (DWORD) dest = Source Private Sub form_load () picture1.picture = LoadPicture ("C:\images.jpg") ' This
When you add a background image to make it run full form picture1.visible = False Picture1.autoredraw = True Me.autoredraw = True Call form_resize Me.refresh Me.autoredraw = False End Sub Private Sub form_resize () Dim Rtn as L Ong Dim hDC1 as Long, hDC2 as long hDC1 = PICTURE1.HDC hDC2 = ME.HDC call Setstretchbltmod
E (hDC2, halftone) Rtn = StretchBlt (hDC2, 0, 0, me.scalewidth, me.scaleheight, hDC1, 0, 0, picture1.scalewidth, Picture1.scaleheight, SRCCO PY) Me.autoredraw = True Me.refresh End SubExcerpt from http://my.csdn.net/chenjl1031 's post