Hey, I have some code, which is quite slow - so would anybody out there be able to optimize it for me??
Thanks~Code:#include <windows.h> int main(int argc, char *argv[]) { HDC hDC; int Width; int Height; long ThisColor; hDC = (HDC)atoi(argv[1]); Width = atoi(argv[2]); Height = atoi(argv[3]); for(int x=0;x<Width;x++) { for(int y=0;y<Height;y++) { ThisColor = GetPixel(hDC, x, y); if (ThisColor==16579836) { SetPixelV(hDC, x, y, RGB(248,232,248)); } if (ThisColor==11842740) { SetPixelV(hDC, x, y, RGB(160,208,248)); } if (ThisColor==10526880) { SetPixelV(hDC, x, y, RGB(200,224,216)); } if (ThisColor==6579300) { SetPixelV(hDC, x, y, RGB(24,16,16)); } } } return 0; }




Reply With Quote