qq的文件夹里的图象背景是绿色的,为什么加载到qq上以后就成了透明色
请各位给小弟个思路
他们用什么方法加载上去的

解决方案 »

  1.   

    'This project needs 2 pictureboxes
    'Picturebox1 must contain a picture with a lot of white pixels (we're going to use white as transparent color)
    Private Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Boolean
    Private Sub Form_Load()
        'KPD-Team 1999
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Picture1.AutoSize = True
        'API uses pixels
        Picture1.ScaleMode = vbPixels
        Picture2.ScaleMode = vbPixels
    End Sub
    Private Sub Picture2_Paint()
        'If we don't call DoEvents first, our transparent image will be completely wrong
        DoEvents
        TransparentBlt Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, vbWhite
    End Sub
      

  2.   

    crTransparent是源图的要透明的颜色
      

  3.   

    再问问,如果只想用一个picturebox,怎么编
      

  4.   

    我想用一个picture显示透明的图片,不知道用CreateCompatibleDC这个函数怎么获取原图
    网上基本讲的是获取屏幕的例子,再给讲讲