LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with loading .bmp or .png files.

When I try to load a .bmp (or .png) file (with the example from the LabView-Homepage) I do not get the picture. There are only lines which (I guess when they are in the right order) will display the image correctly. Can you help me?

Thanks,

Armin Herzer

P.S.: I'm using LabView 6.0 for Linux
0 Kudos
Message 1 of 10
(3,532 Views)
Armin,

Which example are you talking about?

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 10
(3,532 Views)
Use the following link

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/02971a30f5d8fc6986256a0a004f11a0?OpenDocument

The example is for a BMP file. But even when I convert my images to BMP it doesnt work!

Thanks in advance,

Armin Herzer
0 Kudos
Message 3 of 10
(3,532 Views)
Armin,

I ran that KnowledgeBase Example on a small image I created in Microsoft Paint and then transferred over to a Linux machine. I can load the image well under LabVIEW 6.0.2. If you have not upgraded LabVIEW 6i to 6.0.2, I would suggest doing so. XWindows has grown since LabVIEW 6i was released. LabVIEW 6.0.2 fixes many of these issues, especially with KDE. Find a download link here.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 4 of 10
(3,532 Views)
Hello,

thanks for your fast help. I installed the update int the way it is described in the README (and
checked thereafter the installation with About. I also mass compiled the VI's). But the problem didn't go away. Look at the attachement for the image and the VI.

Thanks again,

Armin Herzer
0 Kudos
Message 5 of 10
(3,532 Views)
Armin,

I have reproduced your issue. However, I am having problems with your image. I tried, for a test, to convert the image to a gif or jpeg. When I did this, I got the lines as well. I used the Windows 2000 Image program and changed the image to a RGB bitmap file. Everything works fine now. It has something to do with the file format of the image when first saved. I would start there.

Randy Hoskin

P.S. I have included the new image for you to test.
0 Kudos
Message 6 of 10
(3,532 Views)
Hello Randy,

thanks! I will try it. But it is indeed strange. I have written a C-programm wich saves the image in PGM-Format. The GIMP reads this image without problems. I use "convert" to make a BMP out of this file. The GIMP handles both pictures without any problem. I will try something new on Thursday and will report my results (if you are still interested).

Thanks,

Armin
0 Kudos
Message 7 of 10
(3,532 Views)
Hello,

yesterday I came across the following: If you save the PGM-Image as a BMP with the following command
convert 00.pbm 00.bmp
you ran into trouble with Labview (because the image is saved in a packed format). If you save the image with this command
convert +compress 00.pbm 00.bmp
Labview displays the image correctly (because packing is now disabled). I suppose, that Labview (at least the Linux version) cannot handle compressed BMP's correctly. You can verify the same with the Gimp. If you enable RLE packing, the image is distorted. If you disable it, everything is o.k.
By the way, I wasn't able to display a PNG Image (but I tried not all variants of saving it). JPG is not of interest, because the image
s that must be processed are not allowed to be compressed with information loss (o.k., I can use 0% compression mode, but then I can use BMP).
Can you verify this behavior with Windows too?
The PGM-Image is created by a C-Programm written by me.
This program acts as a driver for a Leutron LFS-AT framegrabber board and should be included in Labview as a CIN (if I find a way to display the images 🙂

Thanks in advance,

Armin
0 Kudos
Message 8 of 10
(3,532 Views)
Hello,

yesterday I came across the following: If you save the PGM-Image as a BMP with the following command
convert 00.pbm 00.bmp
you ran into trouble with Labview (because the image is saved in a packed format). If you save the image with this command
convert +compress 00.pbm 00.bmp
Labview displays the image correctly (because packing is now disabled). I suppose, that Labview (at least the Linux version) cannot handle compressed BMP's correctly. You can verify the same with the Gimp. If you enable RLE packing, the image is distorted. If you disable it, everything is o.k.
By the way, I wasn't able to display a PNG Image (but I tried not all variants of saving it). JPG is not of interest, because the image
s that must be processed are not allowed to be compressed with information loss (o.k., I can use 0% compression mode, but then I can use BMP).
Can you verify this behavior with Windows too?
The PGM-Image is created by a C-Programm written by me.
This program acts as a driver for a Leutron LFS-AT framegrabber board and should be included in Labview as a CIN (if I find a way to display the images 🙂

Thanks in advance,

Armin
0 Kudos
Message 9 of 10
(3,532 Views)
Armin,

I did reproduce the issue with your original image in Windows as well. Paint read the file OK, but it did not show up in LabVIEW.

Randy Hoskin
0 Kudos
Message 10 of 10
(3,532 Views)