Results 1 to 40 of 59

Thread: [vb6] Class to make Image Controls Support PNG, TIF, GIF Animation

Threaded View

  1. #11

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    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