Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada Fisheries and Oceans Canada / Pêches et Océans Canada - Government of Canada / Gouvernement du Canada
 
Français Contact Us Help Search Canada Site
Home What's New DFO National Site Map Media

Fisheries & Oceans
 
 
Maritimes Region
Fishing Industry
General Public
Marine & Oceans Industry
Media
Students and Teachers
Scientists and Researchers
 
AconIcon ACON       Home/Topics   |   Commands

Graphics Output


The graphics output commands include:
Next Page, Screen Output, PostScript Output, Illustrator Output, PDF Output, GIF Output, Next_GIF, PNG Output, JPEG Output, MIF Output, Graph Layer, SVG Output, WMF Output, GEOTIFF Output, Image_Size, Page Orientation, and GeoTiff_Info.


Next Page

This command starts a new drawing page. This function has no parameters.

When drawing to the screen, the screen is cleared. When drawing to a PostScript file a new page is started within the same file. When drawing to an Illustrator output file, the current file is closed, and a new file is started with a numeric extension (001,002...).

Next_Page();

See the example QuickTime Copy Buf

affects all subsequent drawing commands.


Screen Output

This command selects the screen as the output "device". If a Graphical output file is open, it is closed. All graphics (and graphic text) will be plotted on the screen. Note that the screen is not usually as high resolution and as clear as is created by using either the PostScript output , or Illustrator output "device drivers"

The screen is the default output device when the program is started.

Screen_Output();

initial program state - the screen is the initial output device

affects all subsequent drawing commands.


PostScript Output

This command selects the PostScript output "device driver". All subsequent graphics will be translated to PostScript and written to the PostScript output file. When another device driver is selected (or the user issues the QUIT command), the current PostScript file is closed (with the necessary PostScript commands added to print the page), and the new driver is opened.

This allows the user to created detailed output. Note that the shaded contouring and drawing using the PostScript output is usually higher resolution and detail than that created by using the Screen output device driver.

Note: Font colour and Character_Rotation are not supported.

This command does not actually send the PostScript file to the PostScript printer for printing.

After creating a PostScript output file, and closing the file by changing device drivers, or QUITing the program, you may print the file to the appropriate PostScript compatible printer or you may preview the file using GhostScript or Illustrator before printing.

There is 1 parameter:
file name - the name of the PostScript output file to create.

PostScript_Output("file name");

PostScript_Output("C:/AconOutput/my output file.ps");

initial program state - the screen is the initial output device

affects all subsequent drawing commands.


Illustrator Output

This command selects the Illustrator output "device driver". All subsequent graphics will be translated to Illustrator compatible Encapsulated PostScript and written to the output file (until another device driver is selected, or the user issues the QUIT command).

This allows the user to created detailed contour surface plots which are subsequently editable using Adobe Illustrator. Note that the shaded contouring and drawing using Illustrator output is usually higher resolution and detail than that created by using the Screen output device driver.

After creating a Illustrator output file, and closing the file by changing device drivers, or QUITing the program, you may print the file to the appropriate PostScript compatible printer or you may preview the file using GhostScript or Illustrator before printing.

There are 1 or more parameters:
file name - the name of the Illustrator output file to create.
version - the optional version of Illustrator file to create; 3 » version 3.2, 5 » version 5.0
page scale - the optional scaling factor to apply to the normal 8 1/2 x 11 inch page output size e.g. 2.0.

Notes:

- Illustrator 3 output from ACON preserves any named custom colours defined before (this is a limitation of the current version of ACON) the output file is opened. Objects which are normally clipped to the viewport use the viewport as a mask. This prevents objects which may have their centers within the viewport from "leaking" outside of the viewport (e.g., large scaled symbols).

Illustrator_Output("filename" [,version [,page scale]]);

Illustrator_Output("C:/AconOutput/my output file.ai");

initial program state - the screen is the initial output device

affects all subsequent drawing commands.


PDF Output

This command selects the PDF output "device driver". All subsequent graphics will be translated to PDF compatible PostScript and written to the output file (until another device driver is selected, or the user issues the QUIT command).

This allows the user to created detailed contour surface plots which are subsequently viewable using Adobe Acrobat Reader and editable using Adobe Illustrator. Note that the shaded contouring and drawing using PDF output is usually higher resolution and detail than that created by using the Screen output device driver.

The document created using this output can be viewed by Adobe Acrobat Reader, but not necessarily when Acrobat Reader is embedded as a plug-in within your browser. Commonly when Reader is used as a browser plug-in it encounters memory problems with large documents created by ACON. To avoid this situation, configure Acrobat Reader's Preferences to function as a stand alone application without being integrated into the browser.

There are 2 parameters:
file name - the name of the PDF output file to create.
page scale - the optional scaling factor to apply to the normal 8 1/2 x 11 inch page output size e.g. 2.0.

Notes:

PDF_Output("filename" [,page scale]);

PDF_Output("C:/AconOutput/my output file.pdf");

initial program state - the screen is the initial output device

affects all subsequent drawing commands.


GIF Output

This command selects the GIF output "device driver". All subsequent graphics will be translated to GIF and written to the output file or port (until another device driver is selected, or the user issues the QUIT command).

There are 1 or more parameters:
file name - the name of the GIF output file to create.
x size - the optional x axis size in pixels (default 640).
y size - the optional y axis size in pixels (default 480).
transparency - the optional transparency flag indicating that the background should be transparent (default 1).
transparency red - the optional red component of the colour representing the transparent colour (default 254).
transparency green - the optional green component of the colour representing the transparent colour (default 254).
transparency blue - the optional blue component of the colour representing the transparent colour (default 254).
TrueType - optional flag to indicate that True Type fonts should be used (default 1 = yes).
GIF delay - the delay between frames of an animated GIF. Use Next_GIF to start a new frame.

GIF_Output("filename");

GIF_Output("C:/AconOutput/myGIF.GIF");

affects all subsequent drawing commands.


Next GIF

This command creates a new frame of an animated GIF file.

There is 1 optional parameter:
GIF delay - the new delay between frames of an animated GIF.

Next_GIF(GIF_delay);

Next_GIF(1);

affects subsquent drawing commands when an animated GIF is created.


PNG Output

This command selects the PNG output "device driver". All subsequent graphics will be written to PNG (Portable Network Graphics) bitmap output file (until another device driver is selected, or the user issues the QUIT command).

There are 1 or more parameters:
file name - the name of the PNG output file to create.
source file name - the name of the optional file that a copy is created from. This file may be a PNG, or JPEG file.
x size - the optional x axis size in pixels (default 640).
y size - the optional y axis size in pixels (default 480).
transparency - the optional transparency flag indicating that the background should be transparent (default 1).
transparency red - the optional red component of the colour representing the transparent colour (default 254).
transparency green - the optional green component of the colour representing the transparent colour (default 254).
transparency blue - the optional blue component of the colour representing the transparent colour (default 254).
TrueType - optional flag to indicate that True Type fonts should be used (default 1 = yes).

PNG_Output("filename");

PNG_Output("C:/AconOutput/myPNG.png");

affects all subsequent drawing commands.


JPEG Output

This command selects the JPEG output "device driver". All subsequent graphics will be written to a JPEG bitmap output file(until another device driver is selected, or the user issues the QUIT command).

There are 1 or more parameters:
file name - the name of the JPEG output file to create.
source file name - the name of the optional file that a copy is created from. This file may be a PNG, or JPEG file.
ratio - the optional ratio of the new file image size to the source image file. This assumes that a source file exists that will be used as the input image.
or the following 2 size parameters
x size - the optional x axis size in pixels (default 640).
y size - the optional y axis size in pixels (default 480).
quality - the optional quality flag indicating the degree of quality (1-100). JPEG files use lossy compression which trades file size for image quality (default 50).
transparency - the optional transparency flag indicating that the background should be transparent (default 1).
transparency red - the optional red component of the colour representing the transparent colour (default 254).
transparency green - the optional green component of the colour representing the transparent colour (default 254).
transparency blue - the optional blue component of the colour representing the transparent colour (default 254).
TrueType - optional flag to indicate that True Type fonts should be used (default 1 = yes).

JPEG_Output("filename");

JPEG_Output("C:/AconOutput/myJPEG.jpg");

affects all subsequent drawing commands.


MIF Output

This command selects the Map Info output "device driver". All subsequent graphics will be written to a MIF output file(until another device driver is selected, or the user issues the QUIT command).
This command is tightly associated with the Graph Layer command.

There is 1 parameter:
file name - the name of the MIF output file to create.

After 'opening' a MIF_Output file, you must issue a Graph_Layer() cmd before any graphics are generated, to establish the name of the layer you are drawing in.

With MIF_Output, each time you issue the Graph_Layer() cmd, 2 new files are created, named:
filename_layerSEQ_layerName.mid and filename_layerSEQ_layerName.mif, where
filename is the name you provided in the MIF_Output() cmd (without any .MIF extension),
layerSEQ is the sequence number of this Graph_Layer in the order that they are created (1,2,...), and
layerName is the actual name given in the Graph_Layer(layerName) cmd.

To keep track of what files are created as successive Graph_Layer() cmds are executed, a built in variable @mif_layer is automatically created (as a character matrix) to track the list of files created.

You have to use Map Info to convert these output files into tables and open them in a map graph. You should arrange the sequence of layers by their sequence numbers to ensure that the drawing features appear in their proper drawing order.

MIF_Output("filename");

MIF_Output("C:/AconOutput/myMIF.mif");


Graph Layer

This command defines a Graph Layer. It establishes a name for the layer the user is drawing into.

There are 1 or more parameters:
layer name - the name of the layer to draw into.
attribute identifier(s) - an optional string containing the name and column type of an attribute to be included in the MIF_Output.

The format for an attribute identifier is a field name (without spaces) followed by a column type. Column types may be one of: char (width), integer, or float.
STOCK char (10)
POPULATION integer
BIOMASS real

Graph_Layer("layer name");

Graph_Layer("layer name","atribute name type");

Here is a sample script about the use of MIF_Output and Graph_Layer:

MIF_Output("C:/windows/desktop/testmif.mif");
Data_Projection("MERCATOR");
Graph_Layer("Coastline");
Overlay_RANGS(-1,1,1,1,"BLACK","","");
Graph_Layer("MySquare","Name char(5)");
Draw_Filled(1);
polygon = shape(4 2,-66 44 -66 45 -65 45 -65 44.); Polygon_Draw(polygon,"poly1"); Character_Height(pts(12));
Graph_Layer("Axis");
Axis(Axis_X_Label,Axis_Y_Label,Axis_X_Tic, Axis_Y_Tic,1,0,1,0,0);
Screen_Output();
print(@mif_Layers);


SVG Output

This command opens a Scalable Vector Format output file for drawing. All subsequent graphics will be written to a SVG output file(until another device driver is selected, or the user issues the QUIT command).

There are 3 parameters:
file name - the name of the SVG output file to create.
width - width of resultant picture (in pixels)
height - height of resultant picture (in pixels)

SVG_Output("filename", width, height);

SVG_Output("C:/AconOutput/mySVG.svg",300, 400);


WMF Output

This command opens a WMF (Window Metafile) Format output file for drawing. All subsequent graphics will be written to a WMF output file(until another device driver is selected, or the user issues the QUIT command).

There is 1 parameter:
file name - the name of the WMF output file to create.

WMF_Output("filename");

WMF_Output("C:/AconOutput/myWMF.wmf");


GeoTiff Output

This command opens a GeoTiff output file for drawing. All subsequent graphics will be written to the GeoTiff output file(until another device driver is selected, or the user issues the QUIT command).

There are 1 or more parameters:
file name - the name of the GeoTiff output file to create.
source file name - the name of the optional file that a copy is created from. This file may be a PNG, or JPEG file.
ratio - the optional ratio of the new file image size to the source image file. This assumes that a source file exists that will be used as the input image.
or the following 2 size parameters
x size - the optional x axis size in pixels (default 640).
y size - the optional y axis size in pixels (default 480).
transparency - the optional transparency flag indicating that the background should be transparent (default 1).
transparency red - the optional red component of the colour representing the transparent colour (default 254).
transparency green - the optional green component of the colour representing the transparent colour (default 254).
transparency blue - the optional blue component of the colour representing the transparent colour (default 254).
TrueType - optional flag to indicate that True Type fonts should be used (default 1 = yes).

GeoTiff_Output("filename");

GeoTiff_Output("C:/AconOutput/myGEOTiff.tif");

affects all subsequent drawing commands.


Image_Size

This command returns an integer vector containing the dimensions of an image from a file containing a PNG, JPEG, or GIF bitmap.
The values returned are the width and height respectively, in pixels.

There is 1 parameter:
file name - the name of the bitmap file to parse.

Image_Size("file name");

xy = Image_Size("C:/AconOutput/myJPEG.jpg");


Page Orientation

This command selects the page orientation to either portrait or landscape. This command should be issued before selecting the output device or the current orientation will remain in effect. All subsequent graphics (and graphic text) will be rendered using the selected orientation.

As the drawing surface is conceptually square, this command affects the visibly on the paper (the paper is not square). The page origin remains at the lower left corner corner of the page (after rotation).

There is 1 parameter:
orientation index - the orientation of the page; 0 » portrait, 1 » landscape

Page_Orientation(orientation index);

Page_Orientation(1); /* use landscape mode */

PostScript_Output("myfilename");

initial program state - portrait mode

affects all subsequent drawing commands.


GeoTiff_Info

This command the geospatial parameters from a geotiff file.

There is 1 parameter:
filename - name of the geotiff file to parse.

GeoTiff_Info(filename);

GEOTIFF_Info(my_documents("GISDATA/sfa29_24bit.tif"));
C:\DOCUME~1\username/My Documents/GISDATA/sfa29_24bit.tif
Driver: GTiff / GeoTIFF
Size is 22978x16288x3
Projection is ``
Origin = (-68841.648075,3883235.828508)
Pixel Size = (5.000000,-5.000000)
Number of Bands = 3
Band 1
Block=22978x1 Type=Byte, ColorInterp=Red
Min=0.000d, Max=255.000
Band 2
Block=22978x1 Type=Byte, ColorInterp=Green
Min=0.000d, Max=255.000
Band 3
Block=22978x1 Type=Byte, ColorInterp=Blue
Min=0.000d, Max=255.000


AconIcon ACON       Home/Topics   |   Commands



Last Modified : 2005-11-14