LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically resize array element

Solved!
Go to solution

Hi, I need to resize programmatically the element of a Matrix. The External frame of the matrix control should hold the same size, but the internal element should chang their size programmatically.

 

Capture.PNG

 

I did not find any property/method to do this. Expect using Xcontrol I guess.

 

Any idea?

 

Thank you.

 

0 Kudos
Message 1 of 4
(3,473 Views)
Solution
Accepted by topic author logatto

From your image you inserted, i take it that your 'matrix' is a 2D array LED display.

 

In order to resize these elements while maintaining the "original size of the matrix", you have to implement two steps:

1. Resize of the LEDs:

  • Get ArrayElement reference
  • Cast the reference to Boolean
  • Set the width and height for the Boolean to the new value

Please note that now the size of ALL LEDs change. This is because all elements of an array share the same properties (including size) with the exception of the "Value" property!

Also, the Array shell resizes as it still displays the same amount of LEDs (columns, rows)

 

2. Calculate the new number of columns/rows to keep the Array shell at about the same size

  • Calculate the multiplier for the resize in each direction (making LED smaller to half size has the multiplier of 2 for number of rows/columns each)
  • Multiply the number of rows/columns by that multiplier (rounding???)
  • Set the dimension size property for the array shell to the new values

 

Please note that this will "resize the array to about the same size it previously had". Resizes due to rounding issues very likely (there are no 0.5 LEDs available!)

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(3,458 Views)

Thank You.

 

I did not find the reference for the element. It is the very first of the list Smiley Frustrated

 

0 Kudos
Message 3 of 4
(3,450 Views)

Hi logatto,

 

the element reference is a property of the array…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(3,441 Views)