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




Reply With Quote