Results 1 to 39 of 39

Thread: [Vb6] AlphaBlend API function(strange result)

Threaded View

  1. #17
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [Vb6] AlphaBlend API function(strange result)

    Quote Originally Posted by joaquim View Post
    can i combine trasnparentblt() with alphablend() api function?
    Don't think so, you may have to manually process the pixels and then use AlphaBlend:

    Option 1: test it, no guarantee it will work. I don't know if TransparentBlt modifies the alpha channel on a destination 32bpp DIB/bitmap.
    1. Create offscreen 32bpp DIB section & DC
    2. Fill the DIB with all zeros
    3. Use TransparentBLT to draw your image to that DC
    4. Now use AlphaBlend to draw that DC to your control/object
    5. Destroy DC & DIB at some point

    Option 2
    1. Must use 32bpp DIB
    2. For each pixel where the RGB value should be made transparent, set its RGBA value to zero (all 4 bytes of that pixel).
    3. Now use AlphaBlend API
    4. Destroy DIB at some point

    Option 3
    Using GDI+ this can be done. Though that does mean adding GDI+ APIs to your project and learning how to load an image into GDI+, along with using GdipSetImageAttributesColorKeys, GdipSetImageAttributesColorMatrix, and several more of the GDI+ APIs.
    Last edited by LaVolpe; Jun 14th, 2010 at 10:20 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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