starfighter5
17th August 2011 10:50 UTC
nsdialogs Image Transparency
I am trying to get a BMP image on a custom nsdialogs page to have a transparent background. I have seen some suggestions of setting Magenta as the background but this hasn't worked for me.
I am calling the image using...
${NSD_CreateBitmap} 280 10 100 100 ""
Pop $image
; You should make sure the resource - local or http - is valid!
${NSD_SetImage} $image "$PLUGINSDIR\logo.bmp" $1
Anyone any ideas on how to make the background of the image transparent?
T.Slappy
18th August 2011 07:04 UTC
It is very difficult to have really *transparent* bmp pictures.
You need to set one color as mask [e.g. fuchsia 0xFF00FF] and then BitBlt whole picture bit after bit onto form's canvas...
There is much more theory behind it: http://www.codeproject.com/KB/graphi...itmapmask.aspx [This is only example, maybe try to google better example]
I suppose you should create some plugin in C++ which will perform all steps for you.
Also keep in mind that you will still see form behind the picture [usually BtnFace color] so you will not see desktop!
Easiest way is to use use .png/.gif images -> load it using OLE functions http://nsis.sourceforge.net/NsDialogs_SetImageOLE but there are also some problems.
sss123next
15th November 2012 22:46 UTC
hi, same problem here, i already tried SetImageOLE with no success, also found this plugin http://wiz0u.free.fr/prog/nsisSlideshow/#bottom which succesfuly loads bmp, jpeg, png, and some other formats, but again no transparency, with setimageole i have white background and with nsisslideshow plugin background is black
Anders
16th November 2012 02:07 UTC
If the image has < 256 colors you can call LoadImage yourself with the system plugin and use the LR_LOADMAP3DCOLORS flag.
sss123next
16th November 2012 04:04 UTC
thx for info, and is any solutions for image with > 256 colors ?
Anders
16th November 2012 04:31 UTC
Originally posted by sss123next
thx for info, and is any solutions for image with > 256 colors ?
- Use a icon and not a bitmap :D
- Write a plugin
- Use a fixed background color on the page and image
- Change the "background pixel" in the image to COLOR_3DFACE at runtime with "a million" GDI calls (using the system plugin)
sss123next
16th November 2012 08:01 UTC
thank for info, i will try, i do not like way with millions api calls .... )
sss123next
16th November 2012 09:06 UTC
i can't make even 256 colors image works..., which tool can create one ?
Anders
16th November 2012 09:34 UTC
Paint.net probably can or you can grab a old copy of Paint Shop Pro, any editor out there probably supports it...
sss123next
17th November 2012 08:58 UTC
can someone make example for me please ?