Masternoob
28th March 2012 14:54 UTC
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
MSG
28th March 2012 15:59 UTC
http://stackoverflow.com/questions/2...windows-button
I think this says buttons don't support real transparency.
Anders
28th March 2012 19:37 UTC
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)
Masternoob
29th March 2012 12:52 UTC
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 =/
Anders
29th March 2012 21:06 UTC
The BMP needs to use a palette/color table for the mapping to work IIRC