Orf
May 2nd, 2006, 12:32 PM
Hi everyone.
I store RGB frames coming from a frame grabber in memory, then I process the frame to detect movement and similar things. I need to work on grayscale rames, but they arrive in RGB 24 bit form. I perform the conversion when I fetch the frame, "manually" - that is, (R+G+B)/3.
Now I'd like to let GDI do this stuff for me. I'd like to create a grayscale memory DC, draw my frame there using StretchDIBits (I also needto decrease the resolution at will) then get the new buffer with GetDIBits.
Does the whole thing make sense? (It seems so to me...)
How can I get there?
Thanks.
Ciao.
I store RGB frames coming from a frame grabber in memory, then I process the frame to detect movement and similar things. I need to work on grayscale rames, but they arrive in RGB 24 bit form. I perform the conversion when I fetch the frame, "manually" - that is, (R+G+B)/3.
Now I'd like to let GDI do this stuff for me. I'd like to create a grayscale memory DC, draw my frame there using StretchDIBits (I also needto decrease the resolution at will) then get the new buffer with GetDIBits.
Does the whole thing make sense? (It seems so to me...)
How can I get there?
Thanks.
Ciao.