Chapter Contents |
Previous |
Next |
The GIMPORT Procedure |
About Importing Graphics |
The GIMPORT procedure imports a CGM with which a fileref
has been associated. Using the CGM as input, the procedure displays the graphics
output and creates a catalog entry. The following sections address how to
assign the fileref to the external file (CGM) and how to import the file.
FILENAMEcgm-fileref'external-file';
Replace cgm-fileref with any fileref name
that you want. Replace 'external-file' with the complete file
name of the CGM. You can omit the FILENAME statement if you have already
defined the fileref. You can also specify a fileref with a host command in
some operating environments. See FILENAME Statement for additional information.
In addition, if the CGM contains the FONT LIST element, the procedure lists in the log the fonts used in the CGM. You can change these fonts to SAS software fonts using the MAP statement. If you do not change these fonts to SAS software fonts, the GIMPORT procedure uses a default font.
Because it is easier to determine what adjustments the graphics output needs after it has been displayed, you may want to follow these steps:
Note: Once you have determined the correct
values for the SCALE and TRANSLATE statements for the graphics output produced
by a particular CGM, you can use the same values for all other graphics output
that is generated by the same software application.
These elements are rarely used and their absence should not affect the graphics output produced by the GIMPORT procedure.
About Color Mapping |
You cannot change the color mapping if, in the CGM, the COLOUR SELECTION MODE element is set to DIRECT. In this case, the colors are explicitly defined by the CGM and you cannot change them. However, if the CGM was created with a SAS/GRAPH CGM device driver, you can control the colors by specifying the appropriate colors when you create the graphics output or by changing the colors in the CGM device entry and re-creating the CGM. See The GDEVICE Procedure for details. In addition, you can use a color map with the GREPLAY procedure to remap the colors. In the color map, the FROM color must be specified in RGB format, but the TO color can be any valid color name. See The GREPLAY Procedure for details on color maps.
You can change the color mapping if the COLOUR SELECTION MODE element is set to INDEXED and there is no color table defined in the CGM file. In this case, you can map the colors from the CGM to the colors of your choice by using the COLORS= graphics option when you run the GIMPORT procedure. The CGM colors are mapped to match the order of the colors in the colors list. If the procedure cannot reproduce the colors specified in the CGM, the following message is written to the log:
WARNING: Invalid color index n encountered. It has been mapped to color-name.
Note: The color name from the CGM is converted to the
RGB format for SAS/GRAPH
color names; that is, WHITE is converted to CXFFFFFF, and so on. See SAS/GRAPH Colors for details.
About Pattern Mapping |
If the CGM defines a PATTERN TABLE, then the patterns defined by this table are the patterns that are used and you cannot change them.
If a PATTERN TABLE is not defined in the CGM, under certain conditions you may be able to use SAS/GRAPH PATTERN definitions to control the patterns that are used. If INTERIOR STYLE is set to PATTERN and if a PATTERN TABLE INDEX has been specified, then the GIMPORT procedure uses the PATTERN TABLE INDEX to look up SAS/GRAPH PATTERN definitions. If patterns are defined, the procedure uses the first available pattern. For example, if the PATTERN TABLE INDEX n has been defined, the procedure uses SAS/GRAPH PATTERN definition n. If the SAS/GRAPH PATTERN definition is not the correct pattern type, the procedure modifies the pattern as necessary. If no PATTERN definitions are currently in effect, an INVALID PATTERN TABLE INDEX warning is issued and no pattern is used.
About Font Mapping |
When the CGM is imported, a numbered list of the fonts that are used in the CGM may be displayed in the LOG window. These are the fonts that were available to the application that originally generated the CGM. Depending on how the fonts are represented in the CGM, you may be able to map these fonts to fonts of your choice.
If the font and text in the imported graphics output are produced with move and draw commands that are included in the CGM, then no font name appears in the LOG window and the font cannot be mapped to a different one.
If the fonts used in the imported graphics output are represented in the CGM as a font name accompanied by a text string, they can be mapped to SAS/GRAPH fonts using the MAP statement. You can use the MAP statement if the message "WARNING: Invalid font index n. Font has been mapped to font-name" appears in the LOG window after the list of fonts. This means that font n in the list could not be reproduced and was mapped to the font specified in the FTEXT= graphics option or to the hardware font. You can map this font to a SAS/GRAPH software font of your choice using the MAP statement. See MAP Statement for more information on mapping fonts.
You can also specify a font with the FTEXT= or CHARTYPE= graphics options if both of the following conditions are true:
However, using a graphics option causes all fonts to be mapped to the one that is specified. See SAS/GRAPH Fonts for details of font specification and Adjusting the Graphics Output.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.