Results 1 to 40 of 710

Thread: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

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]Alpha Image Control (PNG, AniGIFs, TIFF, & more)

    GDI+ renders to 32bpp DIB in premultiplied pixels. When using GDI+ one does not need to be concerned with premultiplied or not. Only real exception is when extracting data from the GDI+ image, one must choose which color format they want, other than that, it isn't a concern for nearly all of the GDI+ calls.

    Edited: A downside here is that once you render to GDI DC, you can never get true RGBA back from the DC, it will always be pRGBA.
    As a simple test, I used GdipGraphicsClear on a new DIB passing a transparent white (&H00FFFFFF) and then retrieving the color from the DIB, what I got back was not &H00FFFFFF, it was &H00000000 (black) because of pre-multiplication; any fully transparent color becomes black.

    The GDIpImage class does all the rendering in its Render function. Before rendering, it is just a matter of setting up the device context description beforehand. You tell GDI+ what smoothing/anti-aliasing quality you want to render in, what scale to render in, what angle to render at, and several other options. Once you define that, then you tell GDI+ to render & it does all the pixel X,Y translations while it renders. Rotation with GDI+ is different. You don't manipulate pixels. Rather you tell GDI+ that the device context is rotated and GDI+ translates the pixels as it draws. I have in my possession very fast VB-only rotation code, but it is not faster than GDI+. I also have bilinear and bicubic Vb-only algorithms; again slower than GDI+

    I think the old fashioned code is good to have for basic understanding of how rotation, scaling, etc, etc work. But I don't use any longer for reasons noted in previous post #77.
    Last edited by LaVolpe; Mar 28th, 2012 at 07:33 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}

Tags for this Thread

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