How to convert bitmap to grayscale by pixel intensity using GDI?
I'm looking for the simple solution of how to convert the 32-bit bitmap to grayscale using GDI (not GDI+). Is there a possibility e.g. by changing the bitmap's pallete or something ? Of course there is plenty of examples in Delphi like this one , but I'm looking for a WinAPI function which would do this without iteration through the lines. I haven't found any single GDI function doing this. The easiest way, as David mentioned in his comment, is to scan each line and compute the pixel colors. What you are looking for is probably the luminance formula. There are few variations of this formula