|
-
Dec 7th, 2015, 09:23 PM
#1
Re: [vb6] Class to make Image Controls Support PNG, TIF, GIF Animation
Ok, for this project I've added lots of comments in the top of the class. But let me go over a couple things to help clear it up.
1. I did not add any enhancements to VB's Image control except for these:
-- can load alpha blended bitmaps, can load bitmaps with v4/v5 of the bitmap info header
-- can load CMYK JPGs
-- can load non-placeable WMFs
-- can load XP-style & Vista-style icons. can choose more than just the 1st icon if more than 1 exists
-- can load PNG, TIF
-- can animate GIF
-- unicode file support
Consider the class as an extension of VB's Image control to load more image types, not much more. The returned object is still a stdPicture.
2. The StdPictureEx.LoadPicture method will not create a 32bpp DIB if it does not need to. WMF/EMF are never 32bpp bitmaps unless the optional RequiredFormat parameter is passed as vbPicTypeBitmap.
3. To know if the bitmap is 32bpp premultiplied or not, query the class' IsManaged property and the stdPicture's .Type must be bitmap, not icon or metafile. If .Type = vbPicTypeBitmap and IsManaged = True then premultiplied 32bpp.
Refer my edited #19. I have to use BitBlt.
Using BitBlt will always lose transparency. BitBlt doesn't support it, AlphaBlend does. Even if you didn't use my class, you would not get transparency if you tried to use BitBlt on a stdPicture.handle when the stdPicture contained a VB-loaded GIF. Trying to use AlphaBlend on a VB-loaded image is useless, unless you know for a fact that it is premultiplied 32bpp.
Last edited by LaVolpe; Dec 7th, 2015 at 09:58 PM.
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
|