Win32 Grayscale Bitmap Color

I am writing a program that opens, rotates, scales, inverts color, converts to grayscale and saves a bitmap (.bmp) But I do not think that the conversion to grayscale (i.e. black and white) working on any other code, work great ...

my color inversion code is below ...

 case 3:
{
    hdc=GetDC(hWnd);
    GetClientRect(hWnd,&rt);
    BitBlt(hdc,0,0,rt.right,rt.bottom,hdc,0,0,NOTSRCCOPY);
    ReleaseDC(NULL,hdc);
}

this seems to work, but getting the DC and trying to change it to a gray value does not work with BitBlt ... I would like to get an idea of ​​how to get the DC and convert it to gray ... Thanks WinAPI ...

+3
source share
1 answer

GDI BitBlt.

+2

All Articles