LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different Pictures in a cluster array

Solved!
Go to solution

I have a cluster that has one picture box one numeric and two strings. I placed this cluster into an array so I can keep track of some times. I can change the numeric and string for each array element. When I change the picture it changes the picture for all of them. Is there a way to have a different picture for each array element and not have a picture array?

 

Also why does the picture control act differently than the rest of the controls? Seems inconsistent

Tim
GHSP
0 Kudos
Message 1 of 6
(2,491 Views)

I can't reproduce this issue.

 

How are you changing the picture - by bundling the new picture value and updating the indicator? Perhaps a little code would help. Maybe there is some other issue with the code. Pictures certainly can have different values in arrays.

0 Kudos
Message 2 of 6
(2,428 Views)

Please attach the VI in question, complete with sufficient data that we can examine it ourselves and confirm or refute your observation that it "doesn't work" as we expect.  I know that "voting" to decide if software has a bug or not seems a little silly, but if we cannot reproduce the problem you are having, it makes it more likely that "The Fault, dear Tim, lies in yourself" (a bad paraphrase from Cousin Willie).

 

Bob Schor

0 Kudos
Message 3 of 6
(2,408 Views)

Hi Bob,

 

Thanks for the reply. I was pasting the picture value from the clipboard. My hope was that it would still act like the other controls. If I copy and paste text into a string it does not update every string in the cluster array. However if I copy and paste the picture into the picture control in the cluster array it does update every picture in the cluster array. I can copy and paste a number into the number control and have a different value for each number in the cluster array. The picture control is the only control where if I paste a value into it it changes all of the pictures.

 

I know I can make an array of the paths to each picture and load them when they are called. I was hoping for something more simple and I guess I expected consistent behavior for controls. I will start working on the more complicated solution. I was just hoping that someone had figured out a way to update these controls without having to have the picture in a file somewhere and so it could be easily editable to add new things to my cluster array. 

 

Right now I save the cluster array as a binary file and the picture is saved as part of the binary save. When the cluster is opened it reads the binary file and populates the cluster array including the picture. There is no easy way to just add a picture to a new array and save it so I no longer need the picture. In the past I used a picture ring and just set a value. I can copy and paste into a picture ring and have unique values. but I do not have a way to edit the picture where I can make it clean for the user of the software. 

 

I will figure this out. I was just hopeful this was some that had a more simple answer.

 

Thanks again,

 

Tim

Tim
GHSP
0 Kudos
Message 4 of 6
(2,405 Views)

Ok, it might depend on how exactly you are pasting it in. Is this at run-time or development time?  You need to right click on the Picture control element and choose "Paste Data" to change just that one picture's data. If you do that at runtime or dev-time, you should get the desired result. If (at dev-time) you just select the desired target picture and Ctrl+V on it, yes, every element will get replaced, because it is replacing the elements of the array with the new type (it just happens it is the same type - a picture).

Otherwise please post some code.

0 Kudos
Message 5 of 6
(2,372 Views)
Solution
Accepted by topic author aeastet

Hello All,

 

I found a way to do what I needed to do. I load the picture by having the user click on the picture control. I draw the picture in the picture control after it is selected and then I save my cluster array to a binary file so I do not have to store (or even need the picture) any more.

 

The IT group where I work randomly goes through our network and decides that pictures take up too much space. You have pictures one day and not the next. I can not depend on having the pictures I need to always open them from a path. The binary file allows me to store the picture and still have a very small file size. This is the best of both worlds. 

 

Thank you for the suggestions.

 

Tim
GHSP
0 Kudos
Message 6 of 6
(2,355 Views)