Package | com.yworks.remote |
Class | public class ImageSaveHandler |
Inheritance | ImageSaveHandler AbstractImageExportHandler flash.events.EventDispatcher |
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 | ||
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 image file using method createImageAsByteArray and
saves it using a file reference created by createFileReference. | ImageSaveHandler | ||
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 |
exportCore | () | method |
override protected function exportCore(canvas:CanvasComponent, defaultFileName:String, exportOptions:ExportOptions = null, canvasSprite:Sprite = null):void
Creates the image file using method createImageAsByteArray
and
saves it using a file reference created by createFileReference
.
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.
|