LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is Labview Bitmap format different than Windows?

I have an issue with my bitmap images (depth bit of 1) saved with LabView and a brady printer I'm sending them too with a Serial VISA.

 

I have a VI to create a barcode image and save it as a bitmap. I'm just using the simple graphics Write BMP File VI after a Picture to Pixmap VI. The file looks just fine if opened in MS Paint. Yet when I send it to the printer as a file, it's all garbage.

 

If I use the same VI to save the bitmap (depth bit of 4) then open it with MS Paint, then save it as depth bit of 1. I use the same print VI as before, the file prints beautifully.

 

If I open the bitmap created by my VI (depth bit 1) and the equal on saved by MS Paint in Notepad I see they are not the same.

 

Admittedly I don't know a lot about file structure so probably don't know that I'm doing but any friendly advice would be appreciated. I'll attach the files with a .txt extension so that I can post them.

0 Kudos
Message 1 of 6
(3,683 Views)

I see a couple differences in the files.

 

The LV bitmap is almost twice as large as the MS Paint bitmap.  Opening them up in Notepad, the crazy characters look different.  The LV bitmap has a long line of spaces at the end of the file, probably why the file is longer.

 

I opened both images in LV using the Read Bitmap File and looked at the image cluster.  Both have the same number of pixels (1872) and both have 2 image colors and an image depth of 1.  However for the colors, LV has color 0 as 1677721 and color 1 as 0.  MS paint bitmap is the reverse.  LV pixel 0 is 0 and MS Paint pixel 0 is 255.  (Possibly explained by the different order in the colors?)

 

The 2 images look a lot alike in a LabVIEW picture control and in Paint, but the MS paint bitmap has more black pixels making up the characters as compared to the LV bitmap.

 

Why the 2 files are inherently different, I don't know.  But perhaps those differences explain why the printer is treating them differently.

Message 2 of 6
(3,663 Views)

Yeah, I noticed those same differences. I wish the printed image was just reversed as I can deal with that easy enough (colors 1 and 0 being reversed). It's the extra characters that confuse me. I wish I knew why.

 

Are LabView bitmaps Device Independant Bitmaps(DIB)? I assume so but can't find confirmation. I'm in the process of contacting the printer (Brady) company for their input.  Thanks for checking out the files.

0 Kudos
Message 3 of 6
(3,654 Views)

I don't know that much about bitmap file specifications.

 

I dropped a Write BMP file on a VI.  I opened that up as a subVI.  Then kept opening up the BMP subVI's from level to level.  One interesting subVI was called "Flip and Pad for Picture Control".  It also had a boolean control called "bmp to LV "which had a False constant wired to it in the subVI above that one.

0 Kudos
Message 4 of 6
(3,649 Views)

Ravens Fan wrote:

The LV bitmap has a long line of spaces at the end of the file, probably why the file is longer.


That's the bug.  The spaces (\00) shouldn't be there.

 

George Zou

http://www.geocities.com/gzou999

 

George Zou
0 Kudos
Message 5 of 6
(3,632 Views)
Thanks  for checking those BMP files out. I tried changing the "bmp to LV" constant but it didn't help. I think I'm going to change tactics.
0 Kudos
Message 6 of 6
(3,584 Views)