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.
Solved! Go to Solution.
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.
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)
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??
but yet again that suffers from being readable by ony the write bitmap.vi
so is still stuck to being a 8bit bitmap.
I'm stuck again.
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.
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
I'm glad to hear we've reached a solution, best of luck with the rest of your work.