Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I convert a bitmap image into a binary monochrome image?
Posted
Updated 27-Jun-10 0:10am
v3
Comments
Richard MacCutchan 26-Jun-10 4:55am    
Please explain what your problem is, a bitmap is already stored in binary.
Sandeep Mewara 26-Jun-10 8:20am    
What do you mean by bitmap image into binary? It must already be stored in binary format!
Sweety Khan 26-Jun-10 9:45am    
i m using 24 bit bitmap.
A binary image has only two values for each pixel, 0 and 1 corresponding to black and white (or vice versa).
Niklas L 27-Jun-10 6:11am    
Changed your question to point out that you are interested a monochrome image.

I guess you create a new 1-bit bitmap and then add black or white pixels for every position that corresponds to some colour or shade in the original.
 
Share this answer
 
Use CreateBitmap to create a bitmap of teh same size, 1 bit for color and 1 bit for depth. Select it into a DC (say DestDC).
Select the source bitmap into another DC (say SourceDC), than set the source DC background color (via SetBkColor) to the color you will make white in the destination(the rest will be black).
Than BitBlt the source into the destination.
 
Share this answer
 
yeah.. i've same problem...
anyone give some help for the source code in c++ please...?
 
Share this answer
 
Comments
Christian Graus 2-Aug-10 20:04pm    
You've been given explicit instructions. If you can't work it out from there, buy a book and read it, so that you can understand the answer given, or post your code and ask a specific question instead of asking to be spoon fed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900