Alpha Bending

I used SDL_image lib to load PNG format file(or other
format that supports alpha channel) and tried to set
the alpha value of the surface by using function
SDL_SetAlpha(), it doesn’t work. But it works if the
file loaded is BMP or JPG format. How do solve this
problem??________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

kc low wrote:

I used SDL_image lib to load PNG format file(or other
format that supports alpha channel) and tried to set
the alpha value of the surface by using function
SDL_SetAlpha(), it doesn’t work. But it works if the
file loaded is BMP or JPG format. How do solve this
problem??

Are you sure your PNG has an alpha channel? I’ve been using PNGs with
alpha with no problem at all.

[]s

Adilson.

If I remember correctly surfaces with an alpha channel ignore the
surface wide alpha value. That’s why your BMP’s and Jpeg’s are working
fine, but an alpha channelled PNG isn’t. If you want to change the
alpha of a whole surface that already has an alpha channel, then you’ll
(to the best of my knowledge) have to lock the surface and step through
the ‘pixels’ data scaling the values in the alpha channel itself.On Wed, 2003-07-02 at 15:08, kc low wrote:

I used SDL_image lib to load PNG format file(or other
format that supports alpha channel) and tried to set
the alpha value of the surface by using function
SDL_SetAlpha(), it doesn’t work. But it works if the
file loaded is BMP or JPG format. How do solve this
problem??


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Jimmy <@Jimmy>
Jimmy’s World.org
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030703/a11ba18e/attachment.pgp