LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing "Zoom to fit" in application EXE build

Hello,

in my VI I use Image display. Using property node I have allowed only Zoom button, so that the user can only zoom the displayed picture. When I run the VI, and I open right click pop-menu, there is an item "Zoom to fit". Then I exported this LabVIEW project to EXE application. However, when I run the application and zoom the image, there is no Zoom to fit item in the right click pop-up menu. Is there any possiblity how to display Zoom to fit item also in the EXE application build?
(in the VI source block diagram, there is true boolean value wired to zoom to fit property node of the Image display block)

Thank you a lot for help!
0 Kudos
Message 1 of 10
(7,588 Views)

In your vi properties, under appearance > customise do you have "Allow default run-time shortcut menus" selected? I'm not sure, but it might be worth switching this on/off to see what happens.

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 2 of 10
(7,570 Views)

Hi Thoric,

 

thank you for your reaction.

 

I have tried what you suggest. If I select "Allow default run-time shortcut menus, there are two items: Copy data, Save image. If I switch it off. There is no right click pop-up menu at all.

 

The image which I display is originali extracted from AVI file and goes trough several edge detection and overaly procedures. But I dont think that this can have any influence on  the right click pop-up menu.

 

 

0 Kudos
Message 3 of 10
(7,557 Views)

Hi xombox,

 

I took a look at the Image property "Zoom to fit mode" (Is this the one you are using?) - I do not think this has any influence over the items visible in the shortcut menu.It simply ensures the image is zoomed to fit the viewable area of the image control.

 

Why the image control should have different shortcut menus when built into an application is something I can't explain. I'll keep digging, but maybe somebody else can shed some light on this?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 10
(7,553 Views)

I can't understand yet why the Image control has some unique shortcut menu entries in the development environment that are not visible in built applications, so I've written a little workaround for you. You can customise the shortcut menu items for any front panel control and handle the events for these in the code.

 

I use this NI Tutorial to develop the following, which I hope is helpful:

 

  • If you right click the Image Control and select Advanced > Run-Time Shortcut Menu > Edit...
  • Alter the dropdown menu from Default to Custom.
  • Type "Zoom to Fit" in Item Name:
  • "Zoom to Fit" will autocomplete in Item Tag:
  • Select File > Close, you will be prompted to save the changes, click Yes and Save With Control.


In the block diagram, you will need to write some code to capture the Shortcut menu events and turn on Zoom to Fit for the Image control:

  • Place an event structure on your block diagram (if you haven't got one already).
  • Create a new event for Image, Shortcut Menu Selection (App)
  •  - Note the difference between Shortcut Menu Selection? (App) and Shortcut Menu Selection (App) !
  • Place a case structure into the new event case, and wire the ItemTag to the selector terminal.
  • Replace the "False", Default case with simply Default.
  • Replace "True" with "Zoom to Fit".
  • In this "Zoom to Fit" case, put your Boolean True to the Zoomed to Fit Mode property node.


If you do this with a sensible loop around the event case and a timeout of around 100ms, then the result will be a customised shortcut menu item than allows you to turn on Zoom to Fit for the Image.

 

 

Message Edited by Thoric on 05-13-2009 09:40 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 5 of 10
(7,549 Views)

Hello. Thank you for your posting.

 

I have similar problem and I am trying to my "zoom to fit" button in my front window. Anyway, I cannot find "zoom to fit mode" property node. Could you let me know the path of "zoom to fit mode" property node.

 

Thanks.

0 Kudos
Message 6 of 10
(7,386 Views)

YKey wrote:
[...]Could you let me know the path of "zoom to fit mode" property node.[...]

This property is only available in the IMAQ image display control. The 2D image control does not have this property.

 

If you use the IMAQ image display control, you can find the property in the property list as the third from bottom (at least in LV 2009 eng.). Possibly, you have to scroll down the property selection.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 10
(7,378 Views)

Thank you Norbert,

 

I still cannot find 'zoom to fit mode' property. The third from the bottom is 'snapshot mode' in my case. I am using LabVIEW 8.5. I am attaching my screen. Please give me good comments.

 

Regards,

Youngkey

 

screenshot.jpg

0 Kudos
Message 8 of 10
(7,347 Views)

I am attaching a large image.screenshot.jpg

0 Kudos
Message 9 of 10
(7,346 Views)

Hm, it seems that this is a new feature of the image control. I am using LV 2009...... 

 

Norbert

 

[Edit]: I just checked the readmes and the feature was introduced with NI Vision 8.6 Developement Module. 

Message Edited by Norbert B on 10-05-2009 03:15 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 10
(7,327 Views)