How to draw a transparent image using WinAPI ImageList_DrawIndirect?

I need to draw a 32-bit image from the built-in API with the specified transparency level, but I cannot do this. I am using the call ImageList_DrawIndirectand image state ILS_ALPHAin the structure IMAGELISTDRAWPARAMSpassed in ImageList_DrawIndirect, but it looks like it is not working properly. ComCtl v6 is “attached” to my application, so it is not the cause of the problem.

How to do it?

My code is as follows:

Dim idp As IMAGELISTDRAWPARAMS

idp.cbSize = Len(idp)
idp.himl = m_hIml
idp.hdcDst = hdc
idp.rgbBk = -1
idp.x = xPixels
idp.y = yPixels
idp.i = 0
idp.fState = ILS_ALPHA
idp.Frame = 128

ImageList_DrawIndirect(idp)

It is VB6, but it does not matter - in fact, we only work with pure WinAPI at the moment.

+3
source share
1 answer

. , , , rgbBk.

, - -.

, , rgbBk, , .

+2

All Articles