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?–
- Chris
Epiar Administrator/Programmer
http://epiar.sourceforge.net/