[SDL] PNG Alpha Transparentcy

Christian Leger chrism.leger at gmail.com
Fri Dec 3 14:38:13 PST 2010


I've had this exact problem. I don't even know whether or not the SDL_image
libs support keeping the alpha when loading png's.

What I've done is to write a simple conversion function which takes a 24-bit
image and converts it to a 32-bit image, assigning alpha of 255 everywhere
that the image isn't black, and alpha of 0 everywhere else. If that sounds
like code you could use, I'll gladly send it over.



On Fri, Dec 3, 2010 at 5:11 PM, image28 <image28 at slingshot.co.nz> wrote:

>  I replaced the line SDL_LoadBMP with SDL-image's IMG_Load function in the
> testgl.c program from the tests folder in the SDL source package.
> But the image no long shows up transparent, it has a black background
> around it. I made the transparent png file with the gimp... Any ideas?
> Thanks,
> Image
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20101203/aa0d9f7a/attachment-0008.htm>

More information about the SDL mailing list