Archive: Bitmap w/ transparent background


Bitmap w/ transparent background
I created a bitmap image with transparent background in PhotoShop. When I put that in custom page, the image's background became white. I wonder if Modern UI support bitmap w/ transparent background or converting a specific color (like #FF00FF) into transparent?

Thanks for any help and comments. :)


magenta (#FF00FF) is actually the color which is keyed transparent


I tried that too, didn't work. The custom page loaded the image and leave #FF00FF as background color.


Photoshop might have dithered the colors. Open the bitmap itself in Photoshop and see if it's still #FF00FF. If you haven't seen magenta in other installers, there is no reason it shouldn't work for you.


I checked the source image and the color is #FF00FF. I even capture a screenshot of the installer with the image loaded and examine the image in PhotoShop and I got the same result... :(

Here is the image I used for testing, do you see any problem?


Oops... You were talking about a custom page, not the components page checkboxes. It's not currently possible to make an image transparent in a custom InstallOptions page. InstallOptionsEx might already have that feature. I think I'll add it for 2.05. It seems fairly simple to add and could be useful.


I see, thanks for your help! :D


Latest CVS version supports the TRANSPARENT flag for BITMAP fields in InstallOptions pages. The flag will cause the color of the top left pixel of the bitmap to be transparent. Controls behind the bitmap will be seen-through.


Originally posted by kichik
Latest CVS version supports the TRANSPARENT flag for BITMAP fields in InstallOptions pages. The flag will cause the color of the top left pixel of the bitmap to be transparent. Controls behind the bitmap will be seen-through.
is it not better to provide the transparent color key in the .ini or just use magenta

@kichik: normaly, the BOTTOM LEFT pixel sets transparent color. (seen that in other programs)

@anders: the transparent color key in the .ini would indeed be a very nice feature. just using magenta wouldn't be, as some people may want to use magenta in their pictures.


from what i've seen it's usually the top left corner of the image (that's what all code examples and even the OS use i believe for a few of the native apis). some config on the code would possibly be more beneficial to users i think but that's just me :)

-daz


Anders: That's a great idea. :D Something like this will be nice:

[field 1]
type=bitmap
top=0
bottom=200
left=0
right=200
text=test.bmp
TRANSPARENT=FF00FF

:D


Originally posted by kichik
Latest CVS version supports the TRANSPARENT flag for BITMAP fields in InstallOptions pages. The flag will cause the color of the top left pixel of the bitmap to be transparent. Controls behind the bitmap will be seen-through.
Would anyone be able to clarify and or update this answer with an example.
I'm afraid this means little to me: "TRANSPARENT flag for BITMAP fields in InstallOptions pages"

I have searched for quite a while and cannot get an answer to this question.
Perhaps this answer is no longer valid and there's some other way?

Please look at the examples in your NSIS\Examples\InstallOptions directory. And look for 'flag' in the installoptions readme.

http://nsis.sourceforge.net/Contrib/...ns/Readme.html


Did you tried the png2bmp or bmp2png thing? Check this topic: http://forums.winamp.com/showthread.php?t=324013
PNG supports transparency natively.

Maybe it would be better to use nsDialogs instead of that old .ini files:


InitPluginsDir
File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis-r.bmp"
${NSD_CreateBitmap} 0 0 100% 100% ""
Pop $Image
${NSD_SetImage} $Image $PLUGINSDIR\image.bmp $ImageHandle