809
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Form_Load()
InitGDIPlus
Timer1.Interval = 1
Timer1.Enabled = True
End Sub
Private Sub Form_Paint()
Debug.Print Time & ":paint"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
TerminateGDIPlus
End Sub
Private Sub Timer1_Timer()
Dim gpsMemory As Long
Dim bmpMemory As Long
Dim bmpBackGround As Long
Dim bmpMan As Long
Dim bmpCompass As Long
Dim Graphics As Long
GdipCreateBitmapFromFile StrPtr("d:\2.jpg"), bmpBackGround
GdipCreateBitmapFromFile StrPtr("d:\1.jpg"), bmpMan
GdipCreateBitmapFromFile StrPtr("d:\compass.png"), bmpCompass
GdipCreateBitmapFromScan0 Me.ScaleWidth, Me.ScaleHeight, 0, GpPixelFormat.PixelFormat32bppARGB, ByVal 0, bmpMemory
GdipGetImageGraphicsContext bmpMemory, gpsMemory
' GdipSetSmoothingMode gpsMemory, SmoothingModeAntiAlias
GdipDrawImageRectI gpsMemory, bmpBackGround, 0, 0, Me.ScaleWidth, Me.ScaleHeight
GdipDrawImageI gpsMemory, bmpMan, 0, 0
GdipDrawImageI gpsMemory, bmpCompass, 256, 256
GdipCreateFromHWND Me.hwnd, Graphics
GdipDrawImage Graphics, bmpMemory, 0, 0
GdipDisposeImage bmpMemory
GdipDisposeImage bmpBackGround
GdipDisposeImage bmpMan
GdipDisposeImage bmpCompass
GdipDeleteGraphics gpsMemory
GdipDeleteGraphics Graphics
End Sub