Package | com.yworks.remote |
Class | public class ImageExportHandler |
Inheritance | ImageExportHandler AbstractImageExportHandler flash.events.EventDispatcher |
Property | Defined By | ||
---|---|---|---|
additionalParameters : Object
Get or set an object containing additional parameters that will be
transfered to the service URL. | ImageExportHandler | ||
maxImageSize : ISize
Get or set the maximum allowed image size. | AbstractImageExportHandler |
Method | Defined By | ||
---|---|---|---|
ImageExportHandler(downloadURL:String)
Creates a new export handler that will use the given downloadURL to
download the exported images. | ImageExportHandler | ||
export(canvas:CanvasComponent, defaultFileName:String, exportOptions:ExportOptions = null, canvasSprite:Sprite = null):void
Exports the image using the provided export options. | AbstractImageExportHandler |
Method | Defined By | ||
---|---|---|---|
createFileReference():FileReference
Creates a new FileReference and sets the fileReference
property. | AbstractImageExportHandler | ||
createImageAsByteArray(canvas:CanvasComponent, exportOptions:ExportOptions, canvasSprite:Sprite = null):ByteArray
Create a ByteArray which contains an encoded image of the canvas. | AbstractImageExportHandler | ||
createURLRequest(downloadURL:String):URLRequest
Create the URLRequest instance that will be used for the download request. | ImageExportHandler | ||
createURLVariables(canvas:CanvasComponent, exportOptions:ExportOptions, canvasSprite:Sprite = null):URLVariables
Create the URL variables that will be sent to the server. | ImageExportHandler | ||
decorateExportSprite(sprite:Sprite, m:Matrix, exportOptions:ExportOptions, canvas:CanvasComponent):void
Callback that allows additional painting on the sprite that will be exported as a bitmap. | AbstractImageExportHandler | ||
encodeBitmap(bitmap:BitmapData):ByteArray
Encodes the given bitmap data to a byte array. | AbstractImageExportHandler | ||
exportCore(canvas:CanvasComponent, defaultFileName:String, exportOptions:ExportOptions = null, canvasSprite:Sprite = null):void [override]
Creates the URL variables for the file download using method createURLVariables and
starts a download. | ImageExportHandler | ||
getImageData(canvas:CanvasComponent, exportOptions:ExportOptions, canvasSprite:Sprite = null):BitmapData
Draws the canvas contents to a BitmapData instance. | AbstractImageExportHandler | ||
onCancel(event:Event):void
Called when the user chose the cancel button of the download dialog. | AbstractImageExportHandler | ||
onComplete(evt:Event):void
Called when the export operation has finished succesfully. | AbstractImageExportHandler | ||
onHTTPStatus(evt:HTTPStatusEvent):void
Called when the server sends a HTTP status. | AbstractImageExportHandler | ||
onIOError(evt:IOErrorEvent):void
Called when an IO error occurs while executing the image file download. | AbstractImageExportHandler | ||
onProgress(evt:ProgressEvent):void
Dispatched periodically during the file upload or download operation. | AbstractImageExportHandler | ||
onSecurityError(evt:SecurityErrorEvent):void
Called when a security error occurs while executing the image file download. | AbstractImageExportHandler | ||
onSelect(evt:Event):void
Called when the user has selected a location for the image file download. | AbstractImageExportHandler |
additionalParameters | property |
additionalParameters:Object
Get or set an object containing additional parameters that will be transfered to the service URL.
public function get additionalParameters():Object
public function set additionalParameters(value:Object):void
ImageExportHandler | () | Constructor |
public function ImageExportHandler(downloadURL:String)
Creates a new export handler that will use the given downloadURL to download the exported images.
ParametersdownloadURL:String |
createURLRequest | () | method |
protected function createURLRequest(downloadURL:String):URLRequest
Create the URLRequest instance that will be used for the download request.
Parameters
downloadURL:String — The service URL that was passed upon initialization.
|
URLRequest — An URLRequest instance that will be used in the download method.
|
createURLVariables | () | method |
protected function createURLVariables(canvas:CanvasComponent, exportOptions:ExportOptions, canvasSprite:Sprite = null):URLVariables
Create the URL variables that will be sent to the server.
The default key name that is used for the image url variable is "exportData".
A pre-calculated Sprite
containing a copy of the canvas object tree can be passed to support
the export of lazy-loading image data.
Parameters
canvas:CanvasComponent — The canvas that should be exported to a bitmap.
| |
exportOptions:ExportOptions — The export options for this export.
| |
canvasSprite:Sprite (default = null ) — A pre-calculated canvas Sprite .
|
URLVariables — The URL variables that will be send to the server.
|
See also
exportCore | () | method |
override protected function exportCore(canvas:CanvasComponent, defaultFileName:String, exportOptions:ExportOptions = null, canvasSprite:Sprite = null):void
Creates the URL variables for the file download using method createURLVariables
and
starts a download.
This method is called by the export
method.
Parameters
canvas:CanvasComponent — The canvas to create the image from.
| |
defaultFileName:String — A default file name.
| |
exportOptions:ExportOptions (default = null ) — The export options.
| |
canvasSprite:Sprite (default = null ) — An optional pre-calculated sprite to create the image file from.
|