Still not completely sure what you mean, but try something like this:
int Red, Green, Blue;
COLORREF Color;
for (int i = 0; i < 150; i++) {
for(int j = 0; j < 150; j++) {
Color = hdcMem.GetPixel(j, i);
Red = GetRValue(Color);
Green = GetGValue(Color);
Blue = GetBValue(Color);
Red += (200 - Red ) / 2;
Green += ( 60 - Green) / 2;
Blue += ( 20 - Blue ) / 2;
hdcMem.SetPixel(j, i, RGB((UCHAR)Red, (UCHAR)Green, (UCHAR)Blue));
}
}
But manupulating a picture using GetPixel/SetPixel can be very time consuming, you might consider using GDI+ or maybe directly accessing the pixel-data in the bitmap.
E.g somethig like:
...
Gdiplus::Graphics Gp(hdcMem);
Gp.SetPageUnit(Gdiplus::UnitPixel);
Gdiplus::SolidBrush GBr(Gdiplus::Color(128, 200, 60, 20));
Gp.FillRectangle(&GBr, 0, 0, 150, 150);
...
You might need to change the code here or there, i'm writing this by heart.