LabVIEW APIs Discussions

Showing results for 
Search instead for 
Did you mean: 

Programmatically editing control images

Go to solution

I'm programmatically changing the images that make up various controls using the method AndreyDmitriev described in this dicussion:

When I do this, however, the images are imported into the control at the same size they are in the control and not the size of the image being imported. As such many of my images are getting resized and look ugly in the new controls.

Does anyone know a way to import images programmatically without resizing them? I know I could do this by hand, but frankly, I just don't want to.


David S.
0 Kudos
Message 1 of 2

I don't think there is for someone without access to the LabVIEW source. Replacing the image is a question of finding the image resource and replacing that. While that is not trivial it is a data blob in the file that is locatable without knowing every detail of the control file format. The information about the size of the image in the control is simply part of the control description resources itself. So even if you know how to locate resources in the control file, you still don't know which resource you need to have, nor which bytes in that resource define the position and size of the image.

And even with access to the source a possible solution is very likely NOT LabVIEW version independant. NI keeps improving LabVIEW and that also means adding new information to their resource data structures. So even if someone at NI would want to go to the length to write a password protected VI to do that, he or she would very likely be called back because it can't be made a stable VI without spending lots and lots of time on it to not corrupt older versions of LabVIEW files and if that person would just limit to the newest LabVIEW version it would cause complaints about not supporting older versions.

Rolf Kalbermatter
Averna BV
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
0 Kudos
Message 2 of 2