Hi everyone! I'm sure you guys hate it when some person you've never seen here before jumps on and starts asking questions before even bothering to talk to you first, but I'm doing it anyway. *Laugh*
Let me introduce myself. My name is Todd. I'm a student at Edison State College going for a degree in computer programming, and my C++ class has me using Dark GDK. I love the kit, I find it extremely easy to use and it seems very efficient.
Unfortunately, it's not being so easy on me right now. I have had no major problems up until this point, but I'm working on a program which requires me to use a loop to scan every pixel in an image and swap the red and blue components. The best I can get is a big blue splash across the screen which, while it looks neat, is not the functionality I am looking for. *Laugh* Here's my code snippet, if anybody can figure out what I'm doing wrong, or give me a nudge in the right direction, I would be a very happy camper. Thank you in advance!
//**********************************************//
// The swapRedAndBlue function identifies //
// the red and blue RGB components of the //
// background image and swaps them. //
//**********************************************//
void swapRedAndBlue()
{
DWORD pixelColor;
int red;
int green;
int blue;
int width = dbBitmapWidth(0);
int height = dbBitmapHeight(0);
for (int y = 0; y < width; y++)
{
for (int x = 0; x < height; x++)
{
pixelColor = dbPoint(x, y);
red = dbRGBR(pixelColor);
green = dbRGBG(pixelColor);
blue = dbRGBB(pixelColor);
dbDot(blue, green, red);
}
}
}