不显示图片透明区域
的有关信息介绍如下:Option Explicit
Private Declare Function GdiTransparentBlt Lib "gdi32" (ByVal hdc1 As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal W1 As Long, ByVal H1 As Long, ByVal Hdc2 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal W2 As Long, ByVal H2 As Long, ByVal Color As Long) As Long
'这个函数还支持缩放呢
Private Sub Form_Load()
GdiTransparentBlt Me.hDC, 0, 0, 246, 347, Picture1.hDC, 0, 0, 246, 347, RGB(255, 255, 255)
End Sub
最后一个rgb颜色值就是你要过滤的背景色值,我这个例子里把图片框上有白色背景的图片将其白色的背景变成透明后输出显示在窗体上的。
PS做好后保存的时候换个格式,存成PNG格式的试试吧