Archive: HowTo load image to button with transparency


HowTo load image to button with transparency
hello

i am trying to add a image to a button, i found this solution:

System::Call 'user32::LoadImage(i 0, t "$TempFolder\image.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) i.s'
Pop $6
SendMessage $hCtl_InstallMode_Button2 ${BM_SETIMAGE} ${IMAGE_BITMAP} $6


it works but i would like to use a image with transparent background...

it there a way to do this?

thx for your help

http://stackoverflow.com/questions/2...windows-button
I think this says buttons don't support real transparency.


True transparent BMPs (32bpp ARGB) are very rare and the button probably does not support it.

If you pass the MAP flag to LoadImage it can fake it for you (Will not look correct if the user changes color scheme while you are running)


i tried

System::Call 'user32::LoadImage(i 0, t "$TempFolder\Setup.bmp", i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}|${LR_LOADMAP3DCOLORS}) i.s'


but it doesn't seem to do anything =/

The BMP needs to use a palette/color table for the mapping to work IIRC