|
|
发表于 2005-8-26 16:09:00
|
显示全部楼层
Re:用BitBlt实现图片透明,我为什么不成功?
用鼠标按钮的:
Private Const MERGEPAINT = &HBB0226
Private Const SRCAND = &H8800C6
Private Const SRCCOPY = &HCC0020
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC 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 dwRop As Long) As Long
Private Sub Form_Load()
Form1.AutoRedraw = True
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
Picture1.AutoSize = True
Picture2.AutoSize = True
Picture1.Visible = False
Picture2.Visible = False
Timer1.Interval = 20
End Sub
Private Sub Command1_Click()
BitBlt Me.hDC, 10, 0, Picture1.Width, Picture1.Height, Picture1.hDC, 0, 0, MERGEPAINT
BitBlt Me.hDC, 10, 0, Picture2.Width, Picture2.Height, Picture2.hDC, 0, 0, SRCAND
Me.Refresh
End Sub
|
|