Packagecom.yworks.io
Classpublic class ExportOptions
InheritanceExportOptions Inheritance Object

Instances of this class represent export options, e.g. for exporting bitmap images of the canvas content.

See also

com.yworks.remote.ImageExportHandler


Public Properties
 PropertyDefined By
  backgroundColor : uint
The custom background color to be used for the export.
ExportOptions
  defaultOptions : ExportOptions
[static] [read-only] Returns an immutable default ExportOptions instance.
ExportOptions
  hasBackground : Boolean
Whether a custom background should be drawn
ExportOptions
  insets : IRectangle
A rectangle that describes the insets.
ExportOptions
  maxHeight : uint
The maximum height of the exported document.
ExportOptions
  maxWidth : uint
The maximum width of the exported document.
ExportOptions
  scaleMode : uint
Determines how to scale the contents of the exported document.
ExportOptions
Public Methods
 MethodDefined By
  
ExportOptions(scaleMode:uint, insets:IRectangle = null, hasBackground:Boolean = false, backgroundColor:uint = 0xFFFFFF)
Creates an custom export options instance.
ExportOptions
Public Constants
 ConstantDefined By
  SCALE_MODE_FIT : uint = 4
[static] Fit the exported content to the bounds determined by the maxWidth and maxHeight properties.
ExportOptions
  SCALE_MODE_NONE : uint = 1
[static] Do not use a custom scaling for the exported document.
ExportOptions
  SCALE_MODE_VIEWPORT : uint = 2
[static] Use the visible area and zoom factor determined by the current view port.
ExportOptions
Property Detail
backgroundColorproperty
backgroundColor:uint

The custom background color to be used for the export.


Implementation
    public function get backgroundColor():uint
    public function set backgroundColor(value:uint):void

See also

defaultOptionsproperty 
defaultOptions:ExportOptions  [read-only]

Returns an immutable default ExportOptions instance.


Implementation
    public static function get defaultOptions():ExportOptions
hasBackgroundproperty 
hasBackground:Boolean

Whether a custom background should be drawn


Implementation
    public function get hasBackground():Boolean
    public function set hasBackground(value:Boolean):void

See also

insetsproperty 
insets:IRectangle

A rectangle that describes the insets. x is the left inset, y is the top inset, width is the right inset, and height is the bottom inset.


Implementation
    public function get insets():IRectangle
    public function set insets(value:IRectangle):void
maxHeightproperty 
maxHeight:uint

The maximum height of the exported document.

The exact interpretation of this property depends on the value of the scaleMode property.


Implementation
    public function get maxHeight():uint
    public function set maxHeight(value:uint):void

See also

maxWidthproperty 
maxWidth:uint

The maximum width of the exported document.

The exact interpretation of this property depends on the value of the scaleMode property.


Implementation
    public function get maxWidth():uint
    public function set maxWidth(value:uint):void

See also

scaleModeproperty 
scaleMode:uint

Determines how to scale the contents of the exported document.

One of


Implementation
    public function get scaleMode():uint
    public function set scaleMode(value:uint):void
Constructor Detail
ExportOptions()Constructor
public function ExportOptions(scaleMode:uint, insets:IRectangle = null, hasBackground:Boolean = false, backgroundColor:uint = 0xFFFFFF)

Creates an custom export options instance.

Parameters
scaleMode:uint (default = NaN) — Determines how to scale the contents.

One of

  • SCALE_MODE_NONE
  • SCALE_MODE_VIEWPORT
  • SCALE_MODE_FIT

 
insets:IRectangle (default = null) — A rectangle that describes the insets. x is the left inset, y is the top inset, width is the right inset, and height is the bottom inset.
 
hasBackground:Boolean (default = false)
 
backgroundColor:uint (default = 0xFFFFFF)
Constant Detail
SCALE_MODE_FITConstant
public static const SCALE_MODE_FIT:uint = 4

Fit the exported content to the bounds determined by the maxWidth and maxHeight properties. If only one of both properties is set to a value > 0, the other dimension will be chosen as apropriate.

SCALE_MODE_NONEConstant 
public static const SCALE_MODE_NONE:uint = 1

Do not use a custom scaling for the exported document. The natural size of the exported content will be used.

SCALE_MODE_VIEWPORTConstant 
public static const SCALE_MODE_VIEWPORT:uint = 2

Use the visible area and zoom factor determined by the current view port.