[gameprogrammer] Re: Embedding images with alpha channels into a program
- From: kevin-shea@xxxxxxxx
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Tue, 18 May 2004 10:33:05 +0100
Hi,
If I'm understanding what you're wanting to do, it's not too
difficult - basically, you create a C file that wraps the raw
bytes of your PNG file as a byte array. Link this file in when
you compile, then feed data from the array into the PNG
decoder instead of from a file. It isn't too difficult to
extend this so that your resource structure can contain any
number of items - just store the offsets and lengths.
If you're looking for something as simple as a black->trans.
shadow though, why not draw it manually - gradually increase
the transparency as you move away from the dialog. It would be
more flexible than a fixed size bitmap and easier to make into
a configurable aspect of your toolkit.
Hope this helps,
Kev
From: Bernhard Bliem <bernhard.bliem@xxxxxxxxx>
Reply-To: gameprogrammer@xxxxxxxxxxxxx
To: gameprogrammer@xxxxxxxxxxxxx
Subject: [gameprogrammer] Embedding images with alpha channels
into a
program
Date: Sun, 16 May 2004 18:35:34 +0200
Hi,
I'm writing a GUI library on top of SDL. Now I want shadows
for dialogs.
I could use .png files, but I want to compile the images into the
program. I used .xpm for all other images, but this time I
need an alpha
channel, because the shadow is a black to transparent
gradient. AFAIK
.xpm doesn't have an alpha channel. Is there a way to compile
.png files
into the program? Or is there any other format that I can use
for that
purpose, that has an alpha channel?
Thanks,
Bernhard
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
Other related posts: