ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get reference to an image

Hello,
i added a small jpg-iamge with cut&paste to the frontpanel.
How can i get a reference to this image to execute functions when someone clicks on this image?
I know the method of customizing a boolean-OK-button, but its to hard to make the image look like before when doing this.
Or is there an easy way?
Thx for your help
0 Kudos
Message 1 of 10
(3,303 Views)

jpg dropped in the FP are just decorations and I can't remeber seeing any events for decorations.

But if you display the jpg in a picture control, that will give you mouse down, over, .... events.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 10
(3,295 Views)
While it's true that pictures come in as decorations, you could respond to the pane's Mouse Down, Over, etc. events, and interpret where the click occurred based on the coordinates. That would tell you if the click occurred in the picture, and if so, where in the picture.
0 Kudos
Message 3 of 10
(3,286 Views)
Another option is to use a picture control. During the initialization of your VI load the image into the picture control programmatically. You can access the picture control's Mouse Down, Over, etc. events.

Sorry, Ben, missed your bit about the picture control.

Message Edited by smercurio_fc on 09-18-2007 01:06 PM

0 Kudos
Message 4 of 10
(3,284 Views)
"Sorry, Ben, missed your bit about the picture control."
 
No problem.
 
I thought about your approach first off but decided that by the time we find the proper decoration, get its bounds, etc, that it would be alot easier to just use a picure control. It does not have to be loaded dynamically. It could be asimple as making the jprg the default of the picture.
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 10
(3,279 Views)

You can also use a Button with the picture as a decal and the button transparent.  Then use the buttons events.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 10
(3,276 Views)

Sorry didnt finish the read, ignore the button approach.  It would be nice if decorations had events and properties.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 10
(3,274 Views)

"falkpl" <x@no.email> wrote in message
news:1190140809939-582112@exchange.ni.com...
> Sorry didnt finish the read, ignore the button approach.&nbsp; It would be
nice if decorations had events and properties.

It would also be nice if you could right click a decoration, and create a
reference. And if you could give it a label.

Regards,

Wiebe.


(For OnlyOne:
If you want to get a decorations reference, use the following properties:

Panel (returns a panel ref)
Decorrations (rturns a list of all decorrations)

Use an index array to get the right one
)


Message 8 of 10
(3,249 Views)

Yes without being able to name and reference decorations you are forced to use picture controls in labview.  Maybe a simple front picture build into the vi could allow users to decorate the front panel programatically.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 10
(3,242 Views)
I thought of Wiebe's, but was a bit afraid to post because I ve not done much with decorations programatically though. Smiley Happy
- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 10 of 10
(3,239 Views)