ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting a 2D Boolean array to bmp file

I am trying to save a 2D Boolean Array as a 1 bit (black and white) .BMP file, but I am not having any luck. Does anyone have any suggestions on how to do this? I am trying to use the Flatten Pixmap.vi and Write BMP File.vi but it isn't working.

Should the Color Map input to the Write BMP vi be a 2 element array w/ one element being Black and the other being White? If not, what exactly does the Color Map input do?

I've attached a sample of what I'm trying to do. Can anyone tell me why it isn't working? Thanks!
0 Kudos
Message 1 of 4
(3,726 Views)
Actually, after I added the data to the controls, it worked fine for me. Maybe you have failed to properly intitialize the controls to the proper values? Or maybe it is a problem with your version of LabVIEW. I have LabVIEW 7.1 and I see from the VIs that you are using, that you probably have 6.1.

Make sure that your "color table" only has two values (0=Black and 1=White) and the falses will be black (0) and the trues will be white (1).

Again, it worked for me so maybe there is a problem with the calling VI, the data that is being sent, or the version of LabVIEW.

I hope that this helps,
Bob Young
0 Kudos
Message 2 of 4
(3,726 Views)
It does work! 🙂

I was not doing the color table correctly. I am new to LabVIEW, so I am having to learn a lot as I go....

Thanks for the response!

--Chris
0 Kudos
Message 3 of 4
(3,726 Views)
It works fine for me too. Only thing I had to specify was the correct colors in the color table and then make sure not to point at an existing BMP-file.

Please see the revised example I attached. Notice that I saved it with default values so you can reproduce instantly. I saved the VI for your version; 6.0.


I hope this answered your question.

Best regards,
Philip C.
Applications Engineer
National Instruments
www.ni.com/ask
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Message 4 of 4
(3,726 Views)