LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Picture zoom by mouse wheel events

Solved!
Go to solution

Hello everyone,

 

I saw so many post about the topic, however, I do not find solution about my problem.

I followed the example in LabVIEW installation files and I want to try it myself using pictures I like. But there is a customized picture control and I stuck there three days. Please give me

some advises, thank you.

Please see the attached example and my test.

 

Have a good one.

Download All
0 Kudos
Message 1 of 8
(4,991 Views)

The problem is that you create your 2D Picture control in the wrong way...I guess.

I downloaded a png/jpg file from internet, and I follow the description here:

http://digital.ni.com/public.nsf/allkb/328AF568F15B36328625696200511EF0

Then, I change the 2D Picture indicator into a control, and I set the actual value "as default".

Finally I placed this new 2D control into your VI, and the zoom function just works.

0 Kudos
Message 2 of 8
(4,973 Views)

Or just do all in one step:

 

edit: I think you tried to customize the 2D Picture control, yes? So your picture became part of the customized control, that is why it cannot be zoomed. So it was not stored as data in the control, but it was part of its "decoration", like a background. This is what you tried? Anyway, if you follow the description what I gave, you can create 2D Picture indicators/controls with any picture saved with it "as default"...

 

zoom_example.png

Message 3 of 8
(4,968 Views)

Thanks for your quick reply. When I change the indicator to a control, the wire is broken.(seen in the attached .vi)

Did I get it wrong? And how to set the value "as default", I just find Edit -> Make current value default. Thanks again. 

Download All
0 Kudos
Message 4 of 8
(4,935 Views)
Solution
Accepted by topic author chalkwu

🙂 I advice you to go through some LabVIEW tutorials, so you would learn what is indicator/control, etc...

 

Anyway, the VI what you show is OK. You just tried to do the things in the wrong order. First use the 2D Picture control as an indicator, not as a control. A wire cannot "flow in" into a control, but in an indicator. So change that 2D Picture into an indicator first (right mouse click, "change to indicator"). Browse the file you want to load, then run the VI once. You should see the picture now in the 2D Picture indicator. Right mouse click on the indicator, and select "Data operation" --> "Make current value default".

 

Now you can copy/paste this indicator into another VI, or you just in the actual VI (see my example snippet). Either you can use this as indicator (the zoom feature also works), or as a control in your application. If you want to change dynamically the picture during runtime, just keep it as indicator, and inside the While loop. One Event case could be dedicated to a "Load picture" command...Well, all depends on what is your final goal...

0 Kudos
Message 5 of 8
(4,930 Views)

I made it finally. I just learn LabVIEW about 1 week. I watched some tutorial vedios on Youtube. I am on "go through" stage trying understand the concept of the G Language and I know there is a long way to go. Thanks for your patience and warm advice, I really appreciate it and even willing pay. Smiley Tongue

0 Kudos
Message 6 of 8
(4,917 Views)

No need to pay, I also got and still getting lots of help via this forum from the more experienced ones. It is a win-win thing 🙂

Depending on your licence (even if you have student licence!), you might be eligible to access the Core online courses. 

If so, start with the Core 1, you will find it very useful!

http://sine.ni.com/tacs/app/overview/p/ap/of/lang/en/pg/1/sn/n5:selfpacedonline,n24:12725/id/1582/

http://ni.com/myni/self-paced-training

0 Kudos
Message 7 of 8
(4,913 Views)

Both the forum and you are awesome, thumbsUp.

0 Kudos
Message 8 of 8
(4,908 Views)