| | |
conversion to binary image
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2005
Posts: 1
Reputation:
Solved Threads: 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..
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..
![]() |
Similar Threads
- How to convert a GIF image into binary using C programming. (C)
- Reading image as binary file (Python)
- Binary Fraction conversion question (C)
- Number System:Conversion from binary to decimal (C)
- reading binary image using C/C++ (C++)
Other Threads in the C++ Forum
- Previous Thread: Beginning C++ program question
- Next Thread: Help with this code
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





