Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How Can I Create an Image Viewer in Lookout?

Primary Software: Lookout
Primary Software Version: 5.1
Primary Software Fixed Version: N/A
Secondary Software:

Problem: I am using Lookout and would like to view several different images on a panel. For example, I have multiple cameras that create images at a periodic rate and I would like to be able to view these images continuously. How can I create an image viewer in Lookout to accomplish this goal?

Solution: Lookout does not have a native object specifically for image viewing, but you can use a few existing objects together to accomplish this task easily. Internet Explorer can display several types of files, including jpg and gif files. Lookout includes an ActiveX Webbrowser object that allows you to access Internet Explorer from within an ActiveX shell in Lookout. Using this object, you can specify the URL to an image file and display the image.

Simple Viewer


Complete the following steps to create a simple image viewer:
  1. Create an ActiveX Webbrowser object. In the Create Lookout Webbrowser dialog box click Property Pages.
  2. Type the file path to the image (for example, c:\images\1.jpg) in the URL textbox and click OK twice to create the object.
  3. If necessary, place the ActiveX shell onto the panel by left-clicking the Webbrowser object in Object Explorer and dragging it to the panel.
The image file is displayed within the shell.

Manually Controlled Viewer


Complete the following steps to turn the simple viewer into a manually controlled multi-image viewer:
  1. Create a Pot object. In the New Potentiometer dialog box, specify a Minimum of 1 and a Maximum of n where n is the number of different images you want to view. Set the Resolution to 1.
  2. Create an (expression) object with an IF statement to display a different image based on the position of the Pot. For example, if the Pot value is 2, the display shows image 2; if the Pot value is 5, the display shows image 5. Create an expression for the number of images that you would like to display. The syntax of the IF statement is IF(Logical,True Result, False Result) For example, a two-image viewer would use the following expression:IF(POT1.value=1,"c:\images\1.jpg",IF(POT1.value=2,"c:\images\2.jpg",""))
  3. Edit the connections for the Webbrowser object. Set Webbrowser.properties.locationURL=(expression).
  4. If necessary, place the Pot object onto the panel by left-clicking it in Object Explorer and dragging it to the panel.
Switch to run mode and adjust the Pot to see different images displayed within the shell.

Automatically Controlled Viewer


Complete the following steps to turn the manually controlled viewer into an automatic multi-image viewer:
  1. Create a Sequencer object. In the Create Sequencer dialog box, specify the number of States to correspond to the number of images you want to display. Specify a Time Limit for each state, or amount of time delay between images.
  2. Edit the connections for the Pot object. Set Pot.value=Sequencer.State.
The display automatically switches between images based on the time delay that you specified for the Sequencer.




Related Links:

Attachments:





Report Date: 01/29/2004
Last Updated: 03/17/2004
Document ID: 35SDQB2P

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit