虽然我做了一个透明的GIF,可放上去后还是不透明:(

解决方案 »

  1.   

    用 api的 bitblt 将另一个图片画上去就行了  这是实现优质动画的最简单方法
      

  2.   

    用phtoshop处理gif,去底色,才能透明的。我做过很多次都是成功的。欢迎来我的站点编程先锋 http://wlbookwl.myrice.com
      

  3.   

    用gif89a之类的专门控件才能显示透明的gif
      

  4.   

    '可以屏蔽一种颜色拷贝图像
    Option ExplicitPrivate Type TRIVERTEX
        X As Long
        y As Long
        Red As Integer
        Green As Integer
        Blue As Integer
        Alpha As Integer
    End Type
        
    Private Type GRADIENT_RECT
        UpperLeft As Long
        LowerRight As Long
    End TypePrivate Type BLENDFUNCTION
      BlendOp As Byte
      BlendFlags As Byte
      SourceConstantAlpha As Byte
      AlphaFormat As Byte
    End TypePrivate Type GRADIENT_TRIANGLE
        Vertex1 As Long
        Vertex2 As Long
        Vertex3 As Long
    End TypeConst GRADIENT_FILL_RECT_H As Long = &H0
    Const GRADIENT_FILL_RECT_V  As Long = &H1
    Const GRADIENT_FILL_TRIANGLE As Long = &H2
    Const GRADIENT_FILL_OP_FLAG As Long = &HFF
    Const AC_SRC_OVER = &H0Private Declare Function TransparentBlt Lib "msimg32.dll" _
      (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal _
      nYOriginDest As Long, ByVal nWidthDest As Long, ByVal _
      nHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc _
      As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, _
      ByVal nHeightSrc As Long, ByVal crTransparent As Long) As LongPrivate Declare Function GradientFillRect Lib "msimg32" _
    Alias "GradientFill" (ByVal hdc As Long, pVertex As TRIVERTEX, _
    ByVal dwNumVertex As Long, pMesh As GRADIENT_RECT, ByVal _
    dwNumMesh As Long, ByVal dwMode As Long) As Long
    Private Declare Function GradientFillTri Lib "msimg32" _
    Alias "GradientFill" (ByVal hdc As Long, pVertex As TRIVERTEX, _
    ByVal dwNumVertex As Long, pMesh As GRADIENT_TRIANGLE, ByVal _
    dwNumMesh As Long, ByVal dwMode As Long) As LongPrivate Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As LongPrivate Function SysPath() As String  '获得System目录
    Dim S As String * 80
    Dim Length As Long
    Length = GetSystemDirectory(S, Len(S))
    SysPath = Left(S, Length)
    End FunctionPrivate Function ExistDll() As Boolean    '检查是否存在Msimg32.dll
        If Dir(SysPath & "\msimg32.dll") <> "" Then
            ExistDll = True
        ElseIf Dir(SysPath & "32\msimg32.dll") <> "" Then
            ExistDll = True
        Else
            MsgBox "请确认Msimg32.dll存在与Windows系统路径下!", vbCritical + vbOKOnly, "注意"
            ExistDll = False
        End If
        
    End FunctionPublic Sub TransparentCopy _
      (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal _
      nYOriginDest As Long, ByVal nWidthDest As Long, ByVal _
      nHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc _
      As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, _
      ByVal nHeightSrc As Long, ByVal crTransparent As Long)    '带有屏蔽色的拷贝DC
        '参数crTansparent是欲屏蔽的颜色的GRB值
        
        Dim rc As Long
        rc = TransparentBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, crTransparent)
        
    End Sub
      

  5.   

    http://freevbcode.com/code/TrnspBox.zip
      

  6.   

    我不会用,比如我有个picture控件,想把里面的pic01.gif设为屏蔽,屏蔽掉图片里的rgb(0,0,0),该怎么做?