'需一個Image Control , 一個Command1
Option Explicit
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private hBitmap As Long
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
'事先請設form的BorderStyle = 0 沒有框線
Me.AutoRedraw = True
Set Image1.Picture = LoadPicture("e:\bubbles.gif") '請自行找一個背景透明的圖
hBitmap = CreateCompatibleBitmap(Me.hdc, 0, 0)
SelectObject Me.hdc, hBitmap
Me.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
DeleteObject hBitmap
End Sub
|