Results 1 to 1 of 1

Thread: put the image transparent(not the backcolor, but the entire image)

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,964

    put the image transparent(not the backcolor, but the entire image)

    i have these timer:

    Code:
    Private Sub tmrAnimation_Timer()
        If blnDestroyed = True Then
            tmrAnimation.Enabled = False
            Exit Sub
        End If
        On Error GoTo erro
        Const Transparency = (50 * 255) / 100 * &H10000 ' these number is for showing 50% of image
        If lngActualSubImage < PicAnimation.Count - 1 Then
            lngActualSubImage = lngActualSubImage + 1
        Else
            If Strip.Activate = True Then
                lngActualSubImage = 1
            Else
                lngActualSubImage = 0
            End If
        End If
        Set UserControl.Picture = Nothing
        UserControl.Cls
        If blnStretch = True Then
            StretchBlt UserControl.hdc, 0, 0, UserControl.ScaleWidth, UserControl.ScaleHeight, PicAnimation(lngActualSubImage).hdc, 0, 0, PicAnimation(lngActualSubImage).Width, PicAnimation(lngActualSubImage).Height, vbSrcCopy
        ElseIf blnAlphaBlend = True Then
            AlphaBlend UserControl.hdc, 0, 0, UserControl.ScaleWidth, UserControl.ScaleHeight, PicAnimation(lngActualSubImage).hdc, 0, 0, _
    PicAnimation(lngActualSubImage).ScaleWidth, PicAnimation(lngActualSubImage).ScaleHeight, Transparency
        Else
            UserControl.Picture = PicAnimation(lngActualSubImage).Image
        End If
        If blnTransparent = True Then Call SubTransparent
        tmrAnimation.Enabled = False
        RaiseEvent ChangeImage(lngActualSubImage)
        tmrAnimation.Enabled = True
        Exit Sub
    erro:
        tmrAnimation.Enabled = False
        MsgBox Err.Description
    End Sub
    i'm using the AlphBleng() API function for try put the image transparent, but doesn't work... i can't see the image back(the image back is a picturebox image)...
    heres the image for show the problem... the problem is showed in Other Normal Images section...
    can anyone tell me what isn't right?
    thanks
    Last edited by joaquim; Dec 24th, 2009 at 08:02 AM.
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width