ImageGear .NET - Updated
CGM
User Guide > File Formats and Compressions > File Formats > File Formats Reference > CGM
Full Name Computer Graphics Metafile
Format ID ImGearFormats.CGM
File Extension(s) *.cgm
Data Type Metafile Vector Image
Data Encoding Character-based, Binary, Clear-text encoded
Multi-Page Support Yes
Alpha Channel Support No
Metadata Update Support No
ImageGear Platforms Support Win32, Win64, .NET, .NET64
CGM format requires ImageGear.Formats.CGM Namespace.

Supported Versions

Supported Features

ImageGear Read Support

ImageGear Write Support

Please see Supported Features, below, for more information.

ImageGear Filter Control Parameters

Filter Control Parameter Type Default Value Available Values Description
Width Long 512 Any positive value Defines the DIB width of the loaded image. The DIB height is calculated using the file's scale factors.

Comments

This is standardized, platform-independent format used for the interchange of bitmap and vector data.

CGM is a very feature-rich format which attempts to support the graphic needs of many general fields (graphic arts, technical illustration, cartography, visualization, electronic publishing, and so on). While the CGM format is rich in features (many graphical primitives and attributes), it is less complex than PostScript, produces much smaller (more compact) files, and allows the interchange of very sophisticated and artistic images.

Computer Graphics Metafile was developed by experts working on committees under the auspices of the International Standards Organization (ISO) and the American Standards National Institute (ANSI). It was specifically designed as a common format for the platform-independent interchange of bitmap and vector data, and for use in conjunction with a variety of input and output devices. Although CGM incorporates extensions designed to support bitmap (called raster in the CGM specification) data storage, files in CGM format are used primarily to store vector information. CGM files typically contain either bitmap or vector data, but rarely both.

CGM Features Supported for Reading

CGM Element

Supported Attributes

Imported into ImageGear as:

Font names

Font name

ImGearVectorFont objects.

Color Model

Color model

Processed internally.

Affects the interpretation of the colors when reading file content.

Color selection mode

Mode: True color or indexed

Processed internally.

Affects the interpretation of colors.

Background color

RGB color value

Background color of the view.

VDC extent

Left

Top

Right

Bottom

Processed internally.

Affects the interpretation of different ranges. Also, used as a range of the view.

Begin Picture Body

 

Processed internally.

End Picture body

 

Processed internally.

Line and Edge type definition

Type

Pattern

Pattern Length

ImGearVectorLinetype object.

Edge width specification mode

Mode: absolute, scaled, fraction, mm.

Processed internally.

Affects the interpretation of edge width of ImGearVectorLinetype object.

Line width specification mode

Mode: absolute, scaled, fraction, mm.

Processed internally.

Affects the interpretation of line width of ImGearVectorLinetype object.

Marker size specification mode

Mode: absolute, scaled, fraction, mm.

Processed internally.

Affects the interpretation of size of Poly Marker objects.

Line representation

Line type

Line width

Line color

Affects the interpretation of Line and Polyline objects.

Marker

representation

Marker type

Marker size

Marker color

Affects the interpretation of Poly Marker objects.

See Poly Marker section.

Text representation

Font index

Precision

Spacing

Expansion

Color

Affects the interpretation of Text objects.

Fill representation

Font index

Precision

Spacing

Expansion

Color

Used for creating ImGearVectorFilltype object when creating the filling entity.

Edge representation

Edge type

Edge width

Edge color

Affects the interpretation of edges when creating such entity as ImGearVectEntities.FIGURE (see below).

Real Precision

Fixed or floating indicator

Whole part

Fractional part

Processed internally.

Affects the interpretation of many floating-point parameters.

Color index precision

Precision

Processed internally.

Affects the interpretation of color indices.

Index precision

Precision

Processed internally.

Affects the interpretation of indices for different tables.

VDC Integer precision

Precision

Processed internally.

Affects the interpretation of many integer parameters.

VDC real precision

Precision

Processed internally.

Affects the interpretation of many floating-point parameters.

Transparent cell colors

On/Off flag

Color

Processed internally. Turns on/off the transparent color for cell array being represented by ImGearVectEntities.RASTER (see below).

Color precision

Precision

Processed internally.

Affects the interpretation of true colors.

Maximum color index

Maximum index

Processed internally.

Defines a size of the internal palette.

VDC type

Type

Processed internally.

Defines a type of parameters – either integer or float.

Integer precision

Precision

Processed internally.

Affects the interpretation of many integer parameters.

Color model

Color model

The only RGB is supported by the ImageGear CGM filter.

Metafile default replacement

Default replacement flag

Processed internally. Turns on the default setting mode.

Begin picture

 

Defines begin of ImGearVectPage page.

Begin figure

 

Starts ImGearVectEntities.FIGURE entity. All objects being read inside Begin figure/End figure block will be added to the figure entity container.

End figure

 

Finishes ImGearVectEntities.FIGURE entity. See above.

Color table

RGB color values

Processed internally. Creates the internal palette.

Aspect source flags

Type

Value

Processed internally.

Affects the interpretation of different objects and parameters.

Line Width

Width

Specifies a width for ImGearVectorLinetype object.

Line bundle index

Index

Specifies a set of predefined parameters for line objects.

Line type

Type

Specifies a pattern for ImGearVectorLinetype object.

Line color

Color

Specifies ImGearVectAttrib.DRAWCOLOR attribute for entities.

Polyline

Vertices

ImGearVectEntities.POLYLINE entity.

Disjoined polyline

Vertices

ImGearVectEntities.POLYLINE entity.

Connection edge

 

ImGearVectEntities.CONNECTION entity.

Clip rectangle

First corner

Second corner

ImGearVectEntities.VIEWPORT entity.

New region

 

New region for ImGearVectEntities.FIGURE entity.

Text bundle index

Index

Specifies a set of predefined parameters for text objects.

Text color

Color

Specifies a color for ImGearVectorTextObject object.

Character height

Height

Specifies text height for ImGearVectorTextObject object.

Text font index

Index

ImGearVectorFont objects.

Character spacing

Spacing

Specifies character spacing for ImGearVectorTextObject object.

Character expansion factor

Expansion

Used for calculating the character width for ImGearVectorTextObject object.

Restricted text type

Type

Specifies restriction type for ImGearVectEntities.TEXT entity.

Text alignment

Horizontal alignment

Vertical alignment

Specifies an alignment for ImGearVectEntities.TEXT entity.

Text path

Path

Specifies an orientation of ImGearVectEntities.TEXT entity.

Character orientation

XUp

YUp

XBase

YBase

Specifies an orientation of characters for ImGearVectorTextObject object.

Restricted text

Delta width

Delta height

Text position

Final/not final flag

Text string

ImGearVectEntities.TEXT entity.

Append text

Final/not final flag

Text string

ImGearVectEntities.TEXT entity.

Text

Text position

Final/not final flag

Text string

ImGearVectEntities.TEXT entity.

Edge visibility

Visibility

Affects the creation of ImGearVectAttrib.DRAWCOLOR and ImGearVectAttrib.LINETYPE attributes for entities.

Edge width

Width

Specifies ImGearVectAttrib.THICKNESS attribute for entities.

Edge bulge index

Index

Specifies a set of predefined parameters for polygon edges.

Edge type

Type

Specifies a pattern for ImGearVectorLinetype object. Applicable mostly to polylines.

Edge color

Color

Specifies ImGearVectAttrib.DRAWCOLOR attribute for entities.

Fill bundle index

Index

Specifies a set of predefined parameters for ImGearVectorFilltype object.

Interior style

Style

Specifies a pattern for ImGearVectorFilltype object.

Fill color

Color

Specifies ImGearVectAttrib.FILLCOLOR attribute for entities.

Hatch index

Index

Specifies a pattern for ImGearVectorFilltype object if interior style is a hatch.

Polygon

Vertices

ImGearVectEntities.POLYLINEEX entity.

Polygon set

Vertices

Edge out flags

ImGearVectEntities.POLYLINEEX entity.

Rectangle

First corner

Second corner

ImGearVectEntities.POLYLINE entity.

Circle

Center

Radius

ImGearVectEntities.ELLIPSE entity.

Circular arc 3 point

Starting point

Intermediate point

Ending point

ImGearVectEntities.ARC entity.

Circular arc 3 point close

Starting point

Intermediate point

Ending point

Type of arc closure

ImGearVectEntities.ARC entity.

Circular arc center

Center

Delta x for start vector

Delta y for start vector

Delta x for end vector

Delta y for end vector

ImGearVectEntities.ARC entity.

Circular arc center close

Center

Delta x for start vector

Delta y for start vector

Delta x for end vector

Delta y for end vector

Type of arc closure

ImGearVectEntities.ARC entity.

Ellipse

Center

Endpoint of first conjugate diameter

Endpoint of second conjugate diameter

ImGearVectEntities.ELLIPSE entity.

Elliptical arc

Center

Endpoint of first conjugate diameter

Endpoint of second conjugate diameter

Delta x for start vector

Delta y for start vector

Delta x for end vector

Delta y for end vector

ImGearVectEntities.ARC entity.

Elliptical arc close

Center

Endpoint of first conjugate diameter

Endpoint of second conjugate diameter

Delta x for start vector

Delta y for start vector

Delta x for end vector

Delta y for end vector

Type of arc closure

ImGearVectEntities.ARC entity.

Marker bundle index

Index

Specifies a set of predefined parameters for markers. See Poly Marker section.

Marker type

Type

Specifies predefined type of marker. See Poly Marker section.

Marker size

Size

Specifies size of marker. See Poly Marker section.

Marker color

Color

Specifies color of marker. See Poly Marker section.

Poly Marker

Marker positions

ImGearVectEntities.BLOCK entity with several entities in its entity container.

Cell array

Corner point P

Corner point Q

Corner point R

Nx

Ny

Local color precision

Array of cell color values

ImGearVectEntities.RASTER entity.

Begin tile array

Position

Path direction

Line progression direction

Number of tiles in path direction

Number of tiles in line direction

Number of cells/tile in path direction

Number of cells/tile in line direction

Cell size in path direction

Cell size in line direction

Image offset in path direction

Image offset in line direction

Image number of cells  in path direction

Image number of cells in line direction

ImGearVectEntities.BLOCK and ImGearVectEntities.INSERTION entities.

ImGearVectEntities.INSERTION references ImGearVectEntities.BLOCK.

Tile

Compression type

  • Supported types: Group4, 1D Group3, 2D Group3, JPEG
  • Not implemented: Null background, null foreground, bitmap, run length, LZW, PNG

Row padding indicator

Cell color precision

Compression-specific parameters

Bit stream

ImGearVectEntities.RASTER entity.

End tile array

 

Closes “Begin tile array”.

Begin segment

Segment identifier

ImGearVectEntities.BLOCK entity.

Segment display priority

Segment identifier

Priority

Used internally to sort segment blocks in the drawing.

Copy segment

Segment identifier

Transformation matrix

 

ImGearVectEntities.INSERTION entity that references the block specified by segment identifier.

Polybezier

Continuity indicator

Control points

ImGearVectEntities.BEZIER_CURVE entity.

Non-uniform B-spline

Spline order

Number of control points

Control points

List of knots

ImGearVectEntities.NURBS_CURVE entity.

Non-uniform rational B-spline

Spline order

Number of control points

Control points

List of knots

List of weights

ImGearVectEntities.NURBS_CURVE entity.

End Picture

 

Finishes reading the page.

End segment

 

Closes "Begin segment" element.

End metafile

 

Finishes reading the file.

ImageGear Vector Entities Supported for Writing to CGM Format

Only the content of active view is saved in CGM format. View content is transformed using view transformation when saving.

ImageGear Entity or Object

Saved as CGM Element

ImGearVectorView

VDC extent.

Begin picture body.

End picture body.

ImGearVectEntities.BLOCK

Sequence of CGM elements for every entity.

ImGearVectEntities.EASYLINE

Polyline.

ImGearVectEntities.TEXT

Text, Restricted text, Append text, depending on the entity settings.

ImGearVectEntities.POLYLINE

Polyline or polygon, depending on the entity settings.

ImGearVectEntities.INSERTION

Sequence of CGM elements for every entity in the referenced block.

ImGearVectEntities.RASTER

Cell array.

ImGearVectEntities.ARC

Circular arc 3 point, Circular arc 3 point close, Elliptical arc, Elliptical arc close, depending on the entity settings.

ImGearVectEntities.ELLIPSE

Circle or Ellipse, depending on the entity settings.

ImGearVectEntities.NURBS_CURVE

Non-uniform B-spline or Non-uniform rational B-spline, depending on the entity settings.

ImGearVectEntities.BEZIER_CURVE

Polybezier.

ImGearVectEntities.NURBS_SURFACE

The surface is saved as a set of Polyline objects, without interpolation and without taking into account knots and weights.

ImGearVectEntities.VIEWPORT

Clip rectangle.

ImGearVectEntities.FIGURE

“Begin Figure”, several “New Region” and “End Figure” objects.

ImGearVectEntities.CONNECTION

Connecting Edge.

ImGearVectEntities.POLYLINEEX

Polygon set.

ImGearVectEntities.EASY_SURFACE

The surface is saved as a set of Polyline objects.

ImGearVectEntities.SHELL

A set of Polyline or Polygon objects, depending on the entity settings.

ImGearVectEntities.SOLID

Polyline or Polygon object, depending on the entity settings.