ExportImage Method

Takes a snapshot of the specified Enhanced Chart object and exports the resultant image to a file or the system clipboard. You can specify the file format for the exported image.

Syntax

object.ExportImage bstrDest, enuFormat, enuSizeUnits, dblWidth, dblHeight, [lngDPI], [blnLargeFont]

Properties

The ExportImage method syntax has these parts:

Part

Description

object

An object expression that evaluates to an object in the Applies To list.

bstrDest

String. Leave empty for the system clipboard. To export to a file, use the full path.

enuFormat

Enum/Long. Specifies the desired image format. It can be either of type enumImageFormat or a corresponding numerical value, as follows:
ImageFormat_WMF (0): WMF format
ImageFormat_BMP (1): BMP format
ImageFormat_JPG (2): JPG format
ImageFormat_PNG (3): PNG format
ImageFormat_EMF (5): EMF format

NOTE: In order to use the enumImageFormat enumerations, you must add the type library file for object to the references of the VBA project. If the type library file is not included in the references, then only numerical values are accepted. The type libraries for objects in the Applied To list are as follows:

Object

Reference

Type Library File Name

HistogramChart

iFix 2D Histogram Chart Object v1.0 Type Library

Fix2DHistogramChartDll.tlb

LineChart

iFix 2D Line Chart Object v1.0 Type Library

Fix2DLineChartDll.tlb

SPCBarChart

iFix 2D SPC Bar Chart Object v1.0 Type Library

Fix2DSPCBarChartDll.tlb

XYChart

iFix 2D XY Chart Object v1.0 Type Library

Fix2DXYChartDll.tlb

enuSizeUnits

Enum/Long. Specifies in what units the image size is specified with dblWidth and dblHeight. It can be either of type enumSizeUnits or a corresponding numerical value, as follows:

NOTE: Not all the formats support all the units.

Numerical Value

Format

Comments

SizeUnits_Pixels (0): in pixels.

BMP, JPG, PNG

This is the only supported unit for these formats.

SizeUnits_NoSpecificSize (0)

WMF

Specifies that the WMF will use the maximum size (8 inches for the longer dimension and 1200 DPI) and dblWidth and dblHeight only determine the aspect ratio of the image. In such cases, dblWidth and dblHeight should fall between 1 and 10000 inclusively.

SizeUnits_Millimeters (1): in millimeters.

WMF, EMF

Dimensions must be between 25 and 432 millimeters.

SizeUnits_Inches (2): in inches.

WMF, EMF

Dimensions must be between 1 and 17 inches.

SizeUnits_Points (3): in Postscript points (1/72 inches).

WMF, EMF

Dimensions must be between 72 and 1224 points.

NOTE: In order to use the enumSizeUnits enumerations, you must add the type library file for object to the references of the VBA project. If the type library file is not included in the references, then only numerical values are accepted. The type libraries for objects in the Applied To list are as follows:

Object

Reference

Type Library File Name

HistogramChart

iFix 2D Histogram Chart Object v1.0 Type Library

Fix2DHistogramChartDll.tlb

LineChart

iFix 2D Line Chart Object v1.0 Type Library

Fix2DLineChartDll.tlb

SPCBarChart

iFix 2D SPC Bar Chart Object v1.0 Type Library

Fix2DSPCBarChartDll.tlb

XYChart

iFix 2D XY Chart Object v1.0 Type Library

Fix2DXYChartDll.tlb

dblWidth

Double. Specifies the width of the image, in the units specified in enuSizeUnits.

dblHeight

Specifies the heigth of the image, in the units specified in enuSizeUnits.

lngDPI

Long. Specifies the dot density of the image, in dots per inch. Defaults to 300 if left unspecified. It must fall between 50 and 600; otherwise it will be ignored. This parameter does not apply to WMF format if enuSizeUnits is set to SizeUnits_NoSpecificSize.

blnLargeFont

Boolean. Specifies whether large font should be used in the chart image. Defaults to False if left unspecified.

Remarks

Regardless of format and dimension, the aspect ratio must be between 0.1 and 10.

Example

Applies To