SetColorKey & SDL_image

I’m using SDL_SetColorKey to make any pixel that is 0,0,255 (ugly blue)
fully transparent, and this worked fine while I was using SDL_LoadBMP w/
BMPs. Now I’m using SDL_image and those images are PNG. I converted them
to PNG using GIMP and simply changed the surface =
SDL_LoadBMP(“filename.bmp”) to surface = IMG_Load(“filename.png”). Now
SetColorKey seems to not do anything, and the blue isn’t going away. I
thought maybe it was the PNG compression changing the pixel color, but
when I open those same PNGs in GIMP, GIMP reports they are 0,0,255 for
sure.

Any ideas as to why SetColorKey doesn’t work? Here’s an example of what
I’m doing:

temp = IMG_Load(“images/pointer.png”);
SDL_SetColorKey(temp,
SDL_SRCCOLORKEY | SDL_RLEACCEL,
(Uint16) SDL_MapRGB(temp->format, 0, 0, 255));
pointer = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);

But now, pointer still has all the 0,0,255 pixels showing. Any ideas as
to why?–

“Christopher Thielen” wrote in message
news:mailman.1014514024.31717.sdl at libsdl.org

SDL_SetColorKey(temp,
SDL_SRCCOLORKEY | SDL_RLEACCEL,
(Uint16) SDL_MapRGB(temp->format, 0, 0, 255));

‘SDL_MapRGB’ returns an ‘Uint32’ and ‘SDL_SetColorKey’ accepts an
’Uint32’, so why are you casting to ‘Uint16’?–
Rainer Deyke | root at rainerdeyke.com | http://rainerdeyke.com