適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
mx.graphics 

ImageSnapshot  - AS3 Flex

套件mx.graphics
類別public dynamic class ImageSnapshot
繼承ImageSnapshot Inheritance Object

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

A helper class used to capture a snapshot of any Flash component that implements flash.display.IBitmapDrawable, including Flex UIComponents.

An instance of this class can be sent as a RemoteObject to Adobe's LiveCycle Data Services to generate a PDF file of a client-side image. If you need to specify additional properties of the image beyond its contentType, width, and height properties, you should set name/value pairs on the properties object.

In earlier versions of Flex, you set these additional properties on the ImageSnapshot instance itself. This class is still dynamic in order to allow that, but in a future version of Flex it might no longer be dynamic.



公用屬性
 屬性定義自
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
  contentType : String
The MIME content type for the image encoding format that was used to capture this snapshot.
ImageSnapshot
  data : ByteArray
The encoded data representing the image snapshot.
ImageSnapshot
  defaultEncoder : Class
[靜態] The default mx.graphics.codec.IImageEncoder implementation used to capture images.
ImageSnapshot
  height : int
The image height in pixels.
ImageSnapshot
  properties : Object
An Object containing name/value pairs specifying additional properties of the image.
ImageSnapshot
  width : int
The image width in pixels.
ImageSnapshot
公用方法
 方法定義自
  
ImageSnapshot(width:int = 0, height:int = 0, data:ByteArray = null, contentType:String = null)
Constructor.
ImageSnapshot
  
captureBitmapData(source:IBitmapDrawable, matrix:Matrix = null, colorTransform:flash.geom:ColorTransform = null, blendMode:String = null, clipRect:Rectangle = null, smoothing:Boolean = false):BitmapData
[靜態] A utility method to grab a raw snapshot of a UI component as BitmapData.
ImageSnapshot
  
captureImage(source:IBitmapDrawable, dpi:Number = 0, encoder:IImageEncoder = null, scaleLimited:Boolean = true):ImageSnapshot
[靜態] A utility method to grab a snapshot of a component, scaled to a specific resolution (in dpi) and encoded into a specific image format.
ImageSnapshot
  
[靜態] A utility method to convert an ImageSnapshot into a Base-64 encoded String for transmission in text based serialization formats such as XML.
ImageSnapshot
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
公用常數
 常數定義自
  MAX_BITMAP_DIMENSION : int = 2880
[靜態] The maximum width and height of a Bitmap.
ImageSnapshot
屬性詳細資訊

contentType

屬性
contentType:String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The MIME content type for the image encoding format that was used to capture this snapshot. For PNG format images, the MIME type is "image/png". For JPG or JPEG images, the MIME type is "image/jpeg"



實作
    public function get contentType():String
    public function set contentType(value:String):void

data

屬性 
data:ByteArray

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The encoded data representing the image snapshot.



實作
    public function get data():ByteArray
    public function set data(value:ByteArray):void

defaultEncoder

屬性 
public static var defaultEncoder:Class

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The default mx.graphics.codec.IImageEncoder implementation used to capture images. The two implementations are PNGEncoder and JPEGEncoder. The default encoder uses the PNG format.

height

屬性 
height:int

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The image height in pixels.



實作
    public function get height():int
    public function set height(value:int):void

properties

屬性 
properties:Object

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

An Object containing name/value pairs specifying additional properties of the image.

You generally supply such information only when sending an ImageSnapshot instance to Adobe's LiveCycle Data Services in order to generate a PDF file. You can either set the entire object or set individual name/value pairs on the pre-existing empty Object.

預設值為 {}。



實作
    public function get properties():Object
    public function set properties(value:Object):void

width

屬性 
width:int

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The image width in pixels.



實作
    public function get width():int
    public function set width(value:int):void
建構函式詳細資料

ImageSnapshot

()建構函式
public function ImageSnapshot(width:int = 0, height:int = 0, data:ByteArray = null, contentType:String = null)

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constructor.

參數
width:int (default = 0) — Width of the image.
 
height:int (default = 0) — Height of the image.
 
data:ByteArray (default = null) — A byte array to contain the image.
 
contentType:String (default = null) — The encoder format type for the image, either PNGEncoder or JPEGEncoder.
方法詳細資訊

captureBitmapData

()方法
public static function captureBitmapData(source:IBitmapDrawable, matrix:Matrix = null, colorTransform:flash.geom:ColorTransform = null, blendMode:String = null, clipRect:Rectangle = null, smoothing:Boolean = false):BitmapData

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

A utility method to grab a raw snapshot of a UI component as BitmapData.

參數

source:IBitmapDrawable — An object that implements the flash.display.IBitmapDrawable interface.
 
matrix:Matrix (default = null) — A Matrix object used to scale, rotate, or translate the coordinates of the captured bitmap. If you do not want to apply a matrix transformation to the image, set this parameter to an identity matrix, created with the default new Matrix() constructor, or pass a null value.
 
colorTransform:flash.geom:ColorTransform (default = null) — A ColorTransform object that you use to adjust the color values of the bitmap. If no object is supplied, the bitmap image's colors are not transformed. If you must pass this parameter but you do not want to transform the image, set this parameter to a ColorTransform object created with the default new ColorTransform() constructor.
 
blendMode:String (default = null) — A string value, from the flash.display.BlendMode class, specifying the blend mode to be applied to the resulting bitmap.
 
clipRect:Rectangle (default = null) — A Rectangle object that defines the area of the source object to draw. If you do not supply this value, no clipping occurs and the entire source object is drawn.
 
smoothing:Boolean (default = false) — A Boolean value that determines whether a BitmapData object is smoothed when scaled.

傳回值
BitmapData — A BitmapData object representing the captured snapshot or null if the source has no visible bounds.

captureImage

()方法 
public static function captureImage(source:IBitmapDrawable, dpi:Number = 0, encoder:IImageEncoder = null, scaleLimited:Boolean = true):ImageSnapshot

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

A utility method to grab a snapshot of a component, scaled to a specific resolution (in dpi) and encoded into a specific image format.

參數

source:IBitmapDrawable — An object that implements the flash.display.IBitmapDrawable interface.
 
dpi:Number (default = 0) — The resolution in dots per inch. If a resolution is not provided, the current on-screen resolution is used by default.
 
encoder:IImageEncoder (default = null) — The image format used to encode the raw bitmap. The two encoders are PNGEncoder and JPEGEncoder. If an encoder is not provided, the default is PNGEncoder.
 
scaleLimited:Boolean (default = true) — The maximum width or height of a bitmap in Flash is 2880 pixels - if scaleLimited is set to true the resolution will be reduced proportionately to fit within 2880 pixels, otherwise, if scaleLimited is false, smaller snapshot windows will be taken and stitched together to capture a larger image. The default is true.

傳回值
ImageSnapshot — An ImageSnapshot holding an encoded captured snapshot and associated image metadata.

encodeImageAsBase64

()方法 
public static function encodeImageAsBase64(snapshot:ImageSnapshot):String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

A utility method to convert an ImageSnapshot into a Base-64 encoded String for transmission in text based serialization formats such as XML.

參數

snapshot:ImageSnapshot — An image captured as an mx.graphics.ImageSnapshot.

傳回值
String — A string representing the base64 encoded snapshot.

相關 API 元素

常數詳細資訊

MAX_BITMAP_DIMENSION

常數
public static const MAX_BITMAP_DIMENSION:int = 2880

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The maximum width and height of a Bitmap.





[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。