Encapsulates the common abstraction behind a platform specific object (typically a Bitmap) that is used as a source for images.
- height - Number.
Gets the height of this instance. This is a read-only property. - width - Number.
Gets the width of this instance. This is a read-only property. - ios - UIImage.
The iOS-specific image instance. Will be undefined when running on Android. - android - Bitmap.
The Android-specific image instance. Will be undefined when running on iOS.
- loadFromResource( name String ) Boolean
Loads this instance from the specified resource name.- name - String
The name of the resource (without its extension). - return - Boolean
- name - String
- loadFromFile( path String ) Boolean
Loads this instance from the specified file.- path - String
The location of the file on the file system. - return - Boolean
- path - String
- loadFromData( data Object ) Boolean
Loads this instance from the specified native image data.- data - Object
The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS. - return - Boolean
- data - Object
- setNativeSource( source Object ) Boolean
Sets the provided native source object (typically a Bitmap). This will update either the android or ios properties, depending on the target os.- source - Object
The native image object. Will be either a Bitmap for Android or a UIImage for iOS. - return - Boolean
- source - Object
- saveToFile( path String, format ImageFormat, quality? Number ) Boolean
Saves this instance to the specified file, using the provided image format and quality.- path - String
The path of the file on the file system to save to. - format - ImageFormat
The format (encoding) of the image. - quality - (optional) - Number
Optional parameter, specifying the quality of the encoding. Defaults to the maximum available quality. - return - Boolean
- path - String