?
Solved

Convert bmp to 1-bit (B & W)

Posted on 1998-04-07
7
Medium Priority
?
625 Views
Last Modified: 2012-01-15
I have an image on my picture box and I need to save it to a file as a bmp.  I used the "SavePicture" Statement.  However, I need it to be saved as 1-bit (B & W) format.  How do I code this?
0
Comment
Question by:janim
7 Comments
 
LVL 3

Expert Comment

by:byang
ID: 1460646
Don't know how to do this in VB. But you can easily do this using windows API: create an HDC, select a mono HBITMAP into it, then draw your bitmap onto the HDC. Now your HBITMAP contains a black-and-white rending or your image.
0
 
LVL 1

Expert Comment

by:MAVERICK
ID: 1460647
I downloaded an image converter OCX, I will check it out. Is the .BMP in a file (assuming it is!) or is it generated by some code somewhere. If an OCX for the job is what u want then leave a comment.
0
 

Author Comment

by:janim
ID: 1460648
Does this OCX convert bmp files to 1-bit format?  Does this OCX  must be paid for?  Can I run it for FREE and with NO time limit (meaning the control is not limited for a couple of days only).  If so, I would need it.  Thanks in advance.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 46

Expert Comment

by:aikimark
ID: 1460649
You could convert the picture yourself with VB code before converting it.  Change the scalemode to Pixel and use a nested loop to inspect each pixel and change it to black or white.
for Hvar = 1 to picture1.scaleheight
   for Vvar=1 to picture1.scalewidth
     if Picture1.Point(Hvar,Vvar) > BlackCutOffValue then
        Picture1.Pset(HVar,Vvar, vbblack)
     else
        Picture1.Pset(HVar,Vvar, vbwhite)
     endif
   next
next

You will need to double-check my syntax.
0
 

Author Comment

by:janim
ID: 1460650
I need to save the picture as 1-bit format... my picture is already in B&W so I don't need to convert each pixel to B&W.
0
 

Author Comment

by:janim
ID: 1460651
HELP URGENT!!!  How can I convert my picture to 1-bit format using VB?
0
 

Accepted Solution

by:
qhenry earned 100 total points
ID: 1460652
I bought an OCX from a company call LeadTools which can do this.

disclaimer: I am not paid to recommend this product nor do I accept any responsibility for it's appropriatness for the given task.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question