|
-
Jun 14th, 2010, 10:12 AM
#17
Re: [Vb6] AlphaBlend API function(strange result)
 Originally Posted by joaquim
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|