VB用Bitblt实现透明位图显示

VB用Bitblt实现透明位图显示_第1张图片

Visual Basic Code
'API声明
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 Command1_Click (   )  
      BitBlt 目标图.hDC,   ( 目标图.Width / 2 - 掩码图.Width / 2 )   / 15, 0, 掩码图.Width / 15, 掩码图.Height / 15, 掩码图.hDC, 0, 0, vbSrcAnd
      BitBlt 目标图.hDC,   ( 目标图.Width / 2 - 掩码图.Width / 2 )   / 15, 0, 掩码图.Width / 15, 掩码图.Height / 15, 源图.hDC, 0, 0, vbSrcInvert
End Sub

你可能感兴趣的:(function,api,command,basic,vb)