Alpha Problem in PNG

I’m new to SDL.I tried to load PNG file that has an
alpha channel using SDL_image lib.The surface is
displayed properly and the background of the PNG
surface is transparent as expected, but any alpha
value i tried to set, the object always remains
opaque. The problem doesn’t exist if the loaded file
is BMP or JPG format.

I’m using window2000,1.2.5a SDL, 1.2.3 SDL_image.

that’s how I load the surface and set the alpha
value:-

image = IMG_Load(“bc.png”);
SDL_SetAlpha(image,SDL_SRCALPHA,128);________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

The manual says that you cant use that function if the surface in question
already has per-pixel alpha.On 03-Jul-2003, kc low wrote:

I’m new to SDL.I tried to load PNG file that has an
alpha channel using SDL_image lib.The surface is
displayed properly and the background of the PNG
surface is transparent as expected, but any alpha
value i tried to set, the object always remains
opaque. The problem doesn’t exist if the loaded file
is BMP or JPG format.

I’m using window2000,1.2.5a SDL, 1.2.3 SDL_image.

that’s how I load the surface and set the alpha
value:-

image = IMG_Load(“bc.png”);
SDL_SetAlpha(image,SDL_SRCALPHA,128);


Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." – Kristian Wilson, Nintendo, Inc, 1989

Hi!

Am Donnerstag, 3 Juli 2003 schrieben Sie:

image = IMG_Load(“bc.png”);
SDL_SetAlpha(image,SDL_SRCALPHA,128);

you should try using SDL_BlitRect(null, null, null, 128) instead.
I haven’t tried, but a short while back there was a post on this
list that told exact that. maybe you want to search the archives.

Matthias