LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I tell how much memory a vi uses to store a given imported image?

I am editing a vi that someone else has written. It has a fairly complex interface that contains many images. several of them are fairly large. I would like to be able to somehow figure out the size that any given image takes up in memory so that I can selectively remove, compress and re-import images that are too large. Is there anyway to do this in labview, or will I have to completely re-work every image in the entire interface (which contains some partly transparent images over other images and images that rest underneath graphics objects such as graphs- not an easy task) ? Even just knowing the format of the images would be helpful (bmp vs. gif for instance). thanks

global variables make robots angry


0 Kudos
Message 1 of 8
(5,210 Views)

Hi Root Canal,

how do you get the images? Do you get the path of them, or what format is it? If you have it as U8 Array you can calculate an approximate size of it.

Mike

0 Kudos
Message 2 of 8
(5,203 Views)
I suspect they're probably just decorations that were pasted in via the clipboard. In this case there's no properties/methods that I can find to provide this information for a specific decoration. Caveat: this is on LabVIEW 8.2, and not using the scripting object.
Message 3 of 8
(5,194 Views)
The images are not being read by the vi. They were "imported to the front panel" in the following way. Go to the "edit" pull down menu above the front panel. select "import picture to clipboard". paste the imported image on to clipboard using the generic paste command (ctrl+v). When the vi is saved, the picture is magically saved along with it, but there is no apparent way to know what portion of the size of the saved vi is attributable to the picture, and obviously displaying the front panel requires this image to be loaded into RAM, but how much RAM is used? I don't know! Labview now supports compressed images so I know that if I replace these "imported" images on the front panel with highly compressed jpg or gif images, I can reduce the amount of memory needed to display the front panel, but having to re-work the whole front panel of this program would be a mess as the images were used as backgrounds for partially transparent controls and graphs and there are dozens of them.
 
any ideas?
 

global variables make robots angry


0 Kudos
Message 4 of 8
(5,191 Views)

global variables make robots angry


0 Kudos
Message 5 of 8
(5,185 Views)

How many different images are you dealing with?

Perhaps you can make multiple copies of the VI each with a slightly different name.  Go into each one and delete all but one of the images and resave it.  See what that does to the file size.  Sort by file size and the largest VI should have the worst image.

Alternatively, just delete one image from each copy.  Then the smallest file size would be the one that had the largest image deleted from it.

With this knowledge you can go back and fix whatever you need to in the original VI for the maximum benefit and delete all the extra VI copies.



Message Edited by Ravens Fan on 05-08-2008 11:49 PM
0 Kudos
Message 6 of 8
(5,159 Views)
Given that there seems to be no way to directly list the image sizes and I'm only dealing with about two dozen images or so, that should work work very nicely! Your solution is so ingenius that having read it, I can't believe I didn't think of it first. "Genius is the ability to reduce the complicated to the simple." Thanks!

global variables make robots angry


0 Kudos
Message 7 of 8
(5,139 Views)
...and of course, I mispell ingenious. oh well.

global variables make robots angry


0 Kudos
Message 8 of 8
(5,138 Views)