07-10-2015 10:45 PM
Hello everyone,
I have a 2D array of pictures (let's say 4x4). I want to scale/zoom (all of them together) by a factor. Hence I use zoomfactor property node wired to a numeric slider, for any 1 picture element. During runtime, only the picture element for which I have extracted the property node can be seen dynamically scaling, all the rest stay where they are.
Only if I hover over them, or use the increment/decrement button, then the rest of them switch to the scaled value suddenly. Is that how it is supposed to happen? I guess there must be a way out. I would like to see all pictures visible in the front panel to scale together.
I didn't include the VI because it needs the pictures stored on the path to my computer to load everytime it runs.
Hoping to get a solution from the advanced users.
Thanks.
Solved! Go to Solution.
07-11-2015 01:40 AM - edited 07-11-2015 09:14 AM
You can show us your code anyway, even without the pictures.
Why do you use an array of pictures? Wouldn't it be simpler to use a single scalar picture where you tile the four images.
07-11-2015 02:02 AM
Quick and dirty, but it works 🙂
07-11-2015 06:24 PM - edited 07-11-2015 06:53 PM
@ Why do you use an array of pictures? Wouldn't it be simpler to use a single scalar picture where you tile the four images.
Hi altenbach,
Trying to attach the code. It is giving me an error saying
Attached snippet instead.
The reason I am using arrays is to have frames (outlines) around the pictures, otherwise the pictures with white background might not stand apart when tiled together.
Thanks
Hi Blokk,
Thanks for the code. May I get the actual code because I couldn't understand certain functions from the picture.
Regards
PS: Was just browsing the forum and found out (to my great surprise) that the snippet can be simply dragged into Block Diagram and it becomes the code. Did just that. Although I am not still sure what some of the functions are, but it works like a charm. I have the solution now, and am marking it. Thanks!
07-11-2015 07:54 PM - edited 07-11-2015 07:57 PM
nskatlv wrote:The reason I am using arrays is to have frames (outlines) around the pictures, otherwise the pictures with white background might
Well, if you tile your pictures using a single picture indicator, you can of course draw any kind of frames you want, so I don't understand the argument. 😄
(About the attachment problem, try a different browser. what are you using?)
About your snippet: Why are you re-reading the files from disk and redrawing the same pictures over and over as fast as the computer allows. Wouldn't reading them once be enough?
07-11-2015 09:32 PM
@ Well, if you tile your pictures using a single picture indicator, you can of course draw any kind of frames you want, so I don't understand the argument.
I guess. Will try.
@(About the attachment problem, try a different browser. what are you using?)
FireFox.
@About your snippet: Why are you re-reading the files from disk and redrawing the same pictures over and over as fast as the computer allows. Wouldn't reading them once be enough?
That's correct. I just quickly put the while loop before trying uploading the sample VI. Should have put the Read function outside the loop.
Although I have always wondered if there is a way to read file data once, and convert that into a constant stored in the VI itself, so that there need not be any disk path associativity.
Regards
07-11-2015 10:32 PM
@nskatlv wrote:
Although I have always wondered if there is a way to read file data once, and convert that into a constant stored in the VI itself, so that there need not be any disk path associativity.
Read the file, and put an indicator on the wire where the data is read in. Run the VI. Delete the file reading control. Change the indicator to a constant. It should remain on the block diagram with the same data it had when it was first run.
07-13-2015 11:55 AM
Thanks RavensFan,
Although it must be obvious to most of you here, but this is a great find for me.
Regards
07-13-2015 05:15 PM
Glad you find it helpful.
It wasn't obvious to me originally. Not sure if I read about it somewhere else to tip me off, or just discovered it through lots of working with LabVIEW. But I think it is helpful and is worth passing along.