LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scale all pictures in an array together

Solved!
Go to solution

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.

 

 

0 Kudos
Message 1 of 9
(4,493 Views)

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.

0 Kudos
Message 2 of 9
(4,435 Views)
Solution
Accepted by nskatlv

Quick and dirty, but it works 🙂

 

Zoom_feature_2D_picture_array_BD.png

0 Kudos
Message 3 of 9
(4,416 Views)

@ 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!

0 Kudos
Message 4 of 9
(4,151 Views)

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?

 

0 Kudos
Message 5 of 9
(4,107 Views)

@ 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. Smiley Very Happy

 

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

 

0 Kudos
Message 6 of 9
(4,049 Views)

@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.

0 Kudos
Message 7 of 9
(4,014 Views)

Thanks RavensFan,

 

Although it must be obvious to most of you here, but this is a great find for me.

 

Regards

0 Kudos
Message 8 of 9
(3,706 Views)

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.  Smiley Happy

0 Kudos
Message 9 of 9
(3,681 Views)