OT - Image tranparency the wrong color in SDL app

In my project, all my sprites have been downloaded from the same website. I have a black background in my SDL window. All the sprites have transparent backgrounds. One of them shows up on a white square, but when I open that sprite file in GIMP it has a transparent background. How can I find out how to fix this? I can't even figure out how to form it into a single sentence for a google search...
I'm not really sure what you're trying to say here. Here's some of my code:

The method that displays the sprites:

void drawBattle::loadImage(int index, string filename, bool polarity)
if (polarity == true) //It's an ally

cout << "Got to line drawBattle.cpp:198" << endl;

this->aimage[index] = aparty[index].getImage();

Uint32 colorkey = SDL_MapRGB(aimage[index]->format, 0, 255, 0);
SDL_SetColorKey(aimage[index], SDL_SRCCOLORKEY, colorkey);

cout << "Got to drawBattle.cpp:205" << endl;

asrc[index].x = 0;
asrc[index].y = 0;
asrc[index].w = this->aimage[index]->w;
asrc[index].h = this->aimage[index]->h;

cout << "Got to drawBattle.cpp:212" << endl;


cout << "Got to drawBattle.cpp:216" << endl;

adest[index].x = 600;
adest[index].y = index * 100;
adest[index].w = this->aimage[index]->w;
adest[index].h = this->aimage[index]->h;
cout << "Got to drawBattle.cpp:222" << endl;
else //Must be an enemy...
//Add in later the code to access the enemyParty info...

this->eimage[index] = eparty[index].getImage();

colorkey = SDL_MapRGB(eimage[index]->format, 0, 0, 255);
SDL_SetColorKey(eimage[index], SDL_SRCCOLORKEY, colorkey);

esrc[index].x = 0;
esrc[index].y = 0;
esrc[index].w = this->eimage[index]->w;
esrc[index].h = this->eimage[index]->h;


edest[index].x = 0;
edest[index].y = index * 100;
edest[index].w = this->eimage[index]->w;
edest[index].h = this->eimage[index]->h;

aparty[] and eparty[] are Characters, which uses this:

bool Character::loadImage(string f)

int i;

int size = f.size() + 1;
const char* temp = f.c_str();

cout << "Got to line character.cpp:51" << endl;

printf("filename = %s\n", temp);

if (temp != NULL)
image = IMG_Load(temp);
if (image == NULL)
printf("Unable to load image %s: %s\n", temp, SDL_GetError());
return false;
// delete temp;
return true;
A screenshot of the program is available at http://msulli1355.0fees.net/image.png
The sprite itself is at http://msulli1355.0fees.net/Thief.png. It doesn't look transparent in the browser window, but it is.
Topic archived. No new replies allowed.