0

im not a pro in c++, so hope you pros out there can help me out.

I can convert a bmp to grayscale but dont no how to convert it to a binary image..i mean i dont no which functions to use..all helps are greatly appreciated..thank you..this is my structure...

HBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), m_sBitmap, IMAGE_BITMAP, 100,140, LR_LOADFROMFILE | LR_CREATEDIBSECTION);


HBITMAP hGrayBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), m_sBitmap, IMAGE_BITMAP, 100,140, LR_LOADFROMFILE | LR_CREATEDIBSECTION);


BITMAP bm;


GetObject(hGrayBitmap, sizeof(BITMAP), (LPSTR)&bm);


typedef struct tagBITMAP
{
LONG   bmType;
LONG   bmWidth;
LONG   bmHeight;
LONG   bmWidthBytes;
WORD   bmPlanes;
WORD   bmBitsPixel;
LPVOID bmBits;
}
BITMAP, *PBITMAP;

if u guys need 2 see the conversion to grayscale pls do inform me..i thank all opinions and greatly appreciate you helps thank you..

Edited by happygeek: fixed formatting

2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by ~s.o.s~
0

Man dont u ever give up, i think this is the second time u are replying to a dead post. Please dont make this forum a graveyard and follow the forum guidelines before posting.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.