Solved

Convert bmp to 1-bit (B & W)

Posted on 1998-04-07
7
602 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 45

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 50 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

Independent Software Vendors: 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 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