| Package | com.yworks.remote |
| Class | public class ImageExportHandler |
| Inheritance | ImageExportHandler 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. | ImageExportHandler | ||
| Method | Defined By | ||
|---|---|---|---|
ImageExportHandler(downloadURL:String)
Creates a new export handler that will use the given downloadURL to
download the exported images. | ImageExportHandler | ||
Calls the URL that was passed upon initialization. | ImageExportHandler | ||
| Method | Defined By | ||
|---|---|---|---|
createURLRequest(downloadURL:String):URLRequest
Create the URLRequest instance that will be used for the download request. | ImageExportHandler | ||
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. | ImageExportHandler | ||
encodeBitmap(bitmap:BitmapData):ByteArray
Encodes the given bitmap data to a byte array. | ImageExportHandler | ||
Draws the canvas contents to a BitmapData instance. | ImageExportHandler | ||
onCancel(event:Event):void
Called when the user chose the cancel button of the download dialog. | ImageExportHandler | ||
onComplete(evt:Event):void
Called when the export operation has finished succesfully. | ImageExportHandler | ||
onHTTPStatus(evt:HTTPStatusEvent):void
Called when the server sends a HTTP status. | ImageExportHandler | ||
onIOError(evt:IOErrorEvent):void
Called when an IO error occurs while executing the image file download. | ImageExportHandler | ||
onSecurityError(evt:SecurityErrorEvent):void
Called when a security error occurs while executing the image file download. | ImageExportHandler | ||
onSelect(evt:Event):void
Called when the user has selected a location for the image file download. | ImageExportHandler | ||
| additionalParameters | property |
additionalParameters:ObjectGet 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| maxImageSize | property |
maxImageSize:ISizeGet or set the maximum allowed image size.
The size of the exported image will not exceed the size defined by this property.
Note that the maximum size should not be larger than 2880x2880,
the maximum allowed size of a BitmapData instance.
public function get maxImageSize():ISize public function set maxImageSize(value:ISize):voidSee also
| 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):URLRequestCreate 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):URLVariablesCreate the URL variables that will be sent to the server.
The default key name that is used for the image url variable is "exportData".
Parameters
canvas:CanvasComponent — The canvas that should be exported to a bitmap.
| |
exportOptions:ExportOptions — The export options for this export.
|
URLVariables — The URL variables that will be send to the server.
|
See also
| decorateExportSprite | () | method |
protected function decorateExportSprite(sprite:Sprite, m:Matrix, exportOptions:ExportOptions, canvas:CanvasComponent):voidCallback that allows additional painting on the sprite that will be exported as a bitmap.
Parameters
sprite:Sprite — The sprite that will be exported as a bitmap.
The canvas has already been painted on a child display object of the passed Sprite.
| |
m:Matrix — The matrix that is used to scale, rotate, or translate the coordinates of the bitmap. The matrix is already
configured according to the scaleMode set on the exportOptions parameter.
| |
exportOptions:ExportOptions — The export options.
| |
canvas:CanvasComponent — The canvas that should be exported to a bitmap.
|
| encodeBitmap | () | method |
protected function encodeBitmap(bitmap:BitmapData):ByteArrayEncodes the given bitmap data to a byte array.
The default implementation uses PNG encoding.
Parameters
bitmap:BitmapData — The bitmap data to be encoded
|
ByteArray — A byte array containing the encoded bitmap data.
|
| export | () | method |
public function export(canvas:CanvasComponent, defaultFileName:String, exportOptions:ExportOptions = null):voidCalls the URL that was passed upon initialization.
Event handling can be customized by overriding the various protected event handler functions.
Parameters
canvas:CanvasComponent — The graph instance that is to be serialized.
| |
defaultFileName:String — The default file name to be shown in the browser's download dialog.
| |
exportOptions:ExportOptions (default = null) |
| getImageData | () | method |
protected function getImageData(canvas:CanvasComponent, exportOptions:ExportOptions):BitmapData
Draws the canvas contents to a BitmapData instance.
Parameters
canvas:CanvasComponent — The canvas that is to be exported to a bitmap.
| |
exportOptions:ExportOptions — The export options.
|
BitmapData — A bitmap representation of the current canvas contents.
|
| onCancel | () | method |
protected function onCancel(event:Event):voidCalled when the user chose the cancel button of the download dialog.
Parameters
event:Event |
| onComplete | () | method |
protected function onComplete(evt:Event):voidCalled when the export operation has finished succesfully.
This implementation removes the busy cursor.
Parameters
evt:Event |
| onHTTPStatus | () | method |
protected function onHTTPStatus(evt:HTTPStatusEvent):voidCalled when the server sends a HTTP status.
This implementation is empty.
Parameters
evt:HTTPStatusEvent |
| onIOError | () | method |
protected function onIOError(evt:IOErrorEvent):voidCalled when an IO error occurs while executing the image file download.
This implementation shows an alert message, traces the event and removes the busy cursor.
Parameters
evt:IOErrorEvent |
| onSecurityError | () | method |
protected function onSecurityError(evt:SecurityErrorEvent):voidCalled when a security error occurs while executing the image file download.
This implementation shows an alert message, traces the event and removes the busy cursor.
Parameters
evt:SecurityErrorEvent |
| onSelect | () | method |
protected function onSelect(evt:Event):voidCalled when the user has selected a location for the image file download.
This implementation sets the busy cursor.
Parameters
evt:Event |