Showing results for 
Search instead for 
Do you mean 

Launching the Viewer using EML...

by Technical Evangelist on ‎10-02-2015 12:14 PM - edited on ‎03-25-2016 03:26 AM by Anonymous (272 Views)

Question: How do I launch an IMAGINE viewer with an image loaded in it?  I have a requirement to perform this operation via the command line but have been unsuccessful in doing so.  What am I doing wrong?

Answer: This is a common request from ALL developers.  The answer is that you really cannot perform this operation via the command line as it is produced in the Session Log with the syntax below.

viewer truecolor "c:/program files/leica geosystems/imagine and lps 9.0/examples/lanier.img" rgb 4 3 2 transbackground 0;

You will recieve the same error stating that you have a parse error at or near [c].  You have to launch the Viewer first before you can load an Image.  Please note the use of quote() around the filename...

viewer create 2 at 0 128 size 600 600; viewer truecolor quote("C:/Program Files/Leica Geosystems/IMAGINE and LPS 9.0/Examples/lanier.img") rgb 4 3 2 transbackground 0;

You can also launch the GLT...

viewer create glt 2 at 0 128 size 600 600; viewer truecolor quote("C:/Program Files/Leica Geosystems/IMAGINE and LPS 9.0/Examples/lanier.img") rgb 4 3 2 transbackground 0;

Another work around for this is to create a simple EML script that you can call to do all this work for you.  Please see the code below.

component viewerstart {

        filename imagefile {

                title "Image File";

                filetypedef "raster";

        }              

        on startup {

                set imagefile = "C:/Date/Examples/lanier.img";

                viewer create at 0 80 size 512 512;

                viewer truecolor quote($imagefile) rgb 4 3 2 transbackground 0;

                unload; 

        }

}

As you can load this EML by using the IMAGINE Command Line and the following syntax... load "MyEML.eml";  This will launch the viewer with Lanier.img intact.

 

Note: You can find more information about how to use Imagine Application command from:

Online help->Appendices->Application Commands->Alphabetical Index

Contributors