LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to display a bmp in labview?

Hi, all

 

I want to display bmp in labview. I use function: draw image from File in OpenG library.

 

But i report error because this is Unsupported  image depth. My bmp is 16 bit depth.

 

Should i conver it to other supported bit depth?  there are so many files. Anyone can tell

 

 me how to resolve this problem? Thanks very much.

 

attached my bmp file.

 

br

 

0 Kudos
Message 1 of 30
(8,730 Views)

All you need to do is use the Read BMP File and Draw Unflattened Pixmap VIs.

 

display bitmap.png

 

Does this work for you or why are you trying to directly use the OpenG library?

Message Edited by A Person on 01-09-2010 02:22 PM
Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 30
(8,709 Views)

you can look inside the code of "Read BMP Header Info.vi". 16 bits is not a supported BMP bit depth.

 

Supported depths are 1,4,8, 24, 32.

0 Kudos
Message 3 of 30
(8,700 Views)
True, 16-bit is not supported but if it doesn't need to be displayed as a 16-bit image, the code I posted will display it in LabVIEW-or at least it displayed the attached image.
Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 4 of 30
(8,686 Views)

hi, Person,

 

thank you firstly.

 

But in my side, your code don't work, the error happen after exit from read BMP File vi.

 

Did you use the original.bmp to test?

 

I want to display these bmp without converting, because they come from digital oscilloscope.

 

so please help me about it.

 

Thanks.

 

 

0 Kudos
Message 5 of 30
(8,679 Views)

Hi, altenbach,

 

Do you know whether there is a  way to resolve this problem?

 

thanks.

 

br

 

0 Kudos
Message 6 of 30
(8,682 Views)

I apologize, I was just looking at the converted.bmp file and have to eat my words Smiley Surprised  That function does throw the error about the 16-bit bitmap file.

 

What you could use is the NI-IMAQ driver which is part of Vision Acquisition Software.  You can use the IMAQ ReadFile function and display it as shown below.  This WAS tested with original.bmp and was displayed correctly. It's not part of core LabVIEW but does do what you're looking for.

 

display image.png

Alex Person
NI-RIO Product Support Engineer
National Instruments
Message 7 of 30
(8,668 Views)

mmm2006 wrote:

Do you know whether there is a  way to resolve this problem?


All the subVIs of the bmp read function are fully exposed, so it would just be a matter of reading up on the bmp specs, adaping the code accordingly, and saving the resulting code under a new name. I don't know how much effort this would take and if there would be problems.

 

I have not tried this, but since Alex said that the vision drivers support 16 bit BMPs, that's probably a less painful way to do all this. 😉 

Message 8 of 30
(8,666 Views)

Hi, Perosn

 

thank again.

 

just one question. For vison acquistion software, is it related with hardware?

 

I mean if i don't have any related hardware, can i use it in my program?

 

Thank.

 

 

0 Kudos
Message 9 of 30
(8,660 Views)

For vision you will need a seperate license.

Here's a VI that will read 16 bit images. However the colors for 16 bit color are ambigious. So you will need to tinker with the colors.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 10 of 30
(8,630 Views)