Programmatically Resize a Picture Container in an Array With LabVIEW

Updated Aug 3, 2023

Environment

Software

  • LabVIEW

This article goes through the steps on how to resize a picture container inside an array. For the image, it is assumed that the Draw Rectangle VI and then the Build Array Function are being used to create the array with the 2D picture containers but the steps described in this article should apply to other cases too.

To resize the picture container array programmatically you need to follow these steps:
1. Create a reference to the first element of the array by right-clicking on the picture container in the front panel and selecting Create >> Reference.
2. Once the reference to the picture has been created you need to place the To More Specific Class Function on the block diagram which can be found under the Application Control Palette.
3. Create a reference by right-clicking on the target class input >> Create >> Constant. Then click on the class specifier constant and select the class Generic >> GObject >> Control >> Picture.
4. Wire the previously created picture reference to the To More Specific Class Function.
5. Right-click on the specific class reference output and select Create >> Property for Picture Class >> Draw Area Size.
6. If the property node is set to read, right-click on it and select Change All To Write.
7. Wire a control or constant to the input of the property node to change the values of height and width.

Resize picture control array.png