Results 1 to 40 of 110

Thread: [VB6] GDI+ Usage & Samples

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] GDI+ Usage & Samples

    I don't know how you created the clipboard bitmap.
    Here's the only way pvProcessAlphaBitmap will return ARGB vs pARGB or RGB.
    -- One of the R,G,B values was > the alpha channel value & the alpha value is non-zero
    In that routine, you can place a break on this line: lColorFormat = PixelFormat32bppARGB
    That should help indicate that what I said above is correct.

    If it is correct and you are creating your own DIBs with CreateDIBSection API, don't assume the DIB is created with all bytes zeroed out. I have seen similar issues before in other parsing engines I've written in the past. As a matter of habit, it might be wise to call FillMemory and zero out the DIB.

    Let's say DIB was 256x256 & 32 bit.
    Code:
    Private Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (ByRef Destination As Any, ByVal Length As Long, ByVal Fill As Byte)
    
    Dim lSize As Long
    lSize = 256& * 256& * 4&
    FillMemory ByVal DibPtr, lSize, 0
    P.S. In that routine, RGB vs. pARGB/ARGB is only returned if ALL alpha values are either 0 or 255. It does appear the bitmap you passed is using the alpha channel, whether on purpose, accidentally, or dirty when initialized, I can't tell you.
    Last edited by LaVolpe; Jun 4th, 2010 at 01:12 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