LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display bmp or jpg files in an intensity graph?

Hi,

Is there a simple way to convert any bitmap or jpg into a two dimensional array? Can LabView automatically detect all setting form the files?

Thanks in advance.
0 Kudos
Message 1 of 4
(3,699 Views)
If you have at least LabVIEW Full Development take a look at the Picture Control Palette (Graphics & Sound->Graphic Formats). There are fucntions to load BMP, PNG and JPG files into a Picture Control. To convert the resulting picture map into a two dimensional array to display in an Intensity Graph isn't that difficult but will require a little work from your side. For more than 256 colors it will also be difficult to do.

The OpenG Toolkit library at www.OpenG.org does have a function which tries to auto-detect the type of image based on the file ending (the not so smart but easy to do way) and load the image accordingly.

Rolf K
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 4
(3,699 Views)

Hi,

 

Do you have any idea how i could preserve the original multicolors of the jpg/BMP instead of getting  the grayscale or false color?

0 Kudos
Message 3 of 4
(3,013 Views)

Hi Sacha,

 

get the colors of your image. Reduce them to 256 colors max, if more colors are used. Set the z axis of the intensity graph (aka colormap)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(3,010 Views)