new AxNativeImage(sourcenon-null, pixelFormatnon-null)
Creates an instance of AxImage
Parameters:
Name | Type | Description |
---|---|---|
source |
AxImage | Source image to copy |
pixelFormat |
AxPixelFormat | Pixel format for the new image |
Methods
Load(source, callbackContext, callback)
Loads the image from a given stream
If the particular implementation of AxImage does not support the format in which the source data is encoded, it should return false
Different implementations of AxImage can load differently encoded images
Parameters:
Name | Type | Description |
---|---|---|
source |
AxStream | Stream containing the image encoded in its particular format |
callbackContext |
* | An object which is to be passed to the callback. It can be used to serve as a context for the callback or just to pass any relevant data |
callback |
AxImageLoadedCallback | A callback method which is to be called when the loading has finished |
Save(destination, format) → {Boolean}
Saves the image to the given stream in the given encoding format
If the particular implementation of AxImage does not support the requested encoding format, it should return false and shouldn't write anything to the stream
Different implementations of AxImage can save images in different encodings
Parameters:
Name | Type | Description |
---|---|---|
destination |
AxStream | Stream to which the image will be written in the requested format |
format |
String | Format in which to encode the image. For example, such as 'jpg', 'png' and etc. |
Returns:
True if the image was successfully saved to the given stream in the given encoding format
- Type
- Boolean