LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ write bmp conversion issue

Solved!
Go to solution

I am automatically trying to get a 3d graph to write its image contents to a bitmap, i'm currntly using 'get image' property node, and then the 'write bmp.vi' but this gives a low quality bitmap as a result. I have found simply right clicking on the front panel and using 'copy data' and then pasting it into ms paint gives it in really good quality. (see attached)So:

 

There are two different ways to write a bmp file as i have discovered: [n/b i'm running lv 8.2]

 

write bmp.vi & imaq write bmp.vi

 

the write bmp.vi requires an input  of a cluster with the image data within it as a 1d array,the imaq write bmp only needs an input picture.

 

Q: Is there a nice way to convert between them as the write bmp.vi returns lower quility bitmaps than imaq write bmp.vi is capable of.

Or is there a way to dirrectly read from a 3d image other than use 'get image' as a method node? or can the 'copy data' be used to get the data wrote?

 

Chears John P.

0 Kudos
Message 1 of 9
(1,294 Views)
Highlighted

Hi John,

 

I've been taking a look at this problem and it seems that the quality of the image improves when you make the image larger on your front panel.  However you write the data to file it can only use the image information that is reported from the invoke node which is dependent on the image size.  The get image node is still your best option for taking the image data.

 

I suggest that you either plot the graph larger on your front panel or plot the graph twice, once on your front panel at one size then once again within a sub vi at a much larger size.  This front panel wont be visable to the user but you can take the data from this and write to file within the sub vi.

 

I hope this helps and am interested to hear about your eventual solution.

 

Regards,

 

Thomas Clark

 

 

Message Edited by ThomasC on 05-20-2009 12:24 PM
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 9
(1,278 Views)
Highlighted

Hi ThomasC,

thanks for the idea about upsizing, giving it a go now, 

will report back on the quality issue although i'm thinking that the image bit size will still differ.

Is it possible to 'screen grab' a portiona of the front panel as a picture and then save that using the 'imaq write bmp.vi'? as the front panel possition will not differ unless it is moved?

Just a thought.

 

Also the depth of the write bmp.vi seems to be only 8bit, whereas the screan grab comes out at 24bit.

I think this might be the real problem.

 

See attached for comparison (please note they had to be converted to .jpeg as i can't upload a .bmp)

Download All
0 Kudos
Message 3 of 9
(1,266 Views)
Highlighted

after a bit of googling i have found: http://objectmix.com/labview/366713-re-can-i-make-automatic-print-screen-labview.html

which offer a vi for one second captures, so i can grab the whole desktop and crop it down.

Is there a way to simply grab PART of the desktop??

John P.

0 Kudos
Message 4 of 9
(1,263 Views)
Highlighted

but yet again that suffers from being readable by ony the write bitmap.vi

so is still stuck to being a 8bit bitmap.

Hmmmm.

I'm stuck again.

0 Kudos
Message 5 of 9
(1,258 Views)
Highlighted
Solution
Accepted by topic author John Pierson

Hi John,

 

If you set the bit depth of the get image invoke node to be 24 this will also set the bitmap you are writing to file to be 24 bit.  You just need to wire in a constant of 24 to the invoke nodes bit depth terminal.

 

 

Thomas Clark

Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 6 of 9
(1,256 Views)
Highlighted

oddly enough i had just came to the same conclusion.

after i went around checking that everything that wasn't connected wasn't defalting to the incorrect value.

i r numpty.

 

chears for help! - solution atatched below

John P.

0 Kudos
Message 7 of 9
(1,253 Views)
Highlighted

Hi John,

 

I'm glad to hear we've reached a solution, best of luck with the rest of your work.

 

 

Thomas Clark

Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 8 of 9
(1,248 Views)
Highlighted
thanks for the help.
0 Kudos
Message 9 of 9
(1,234 Views)