Classes
ImageSource
ImageSource
Encapsulates the common abstraction behind a platform specific object (typically a Bitmap) that is used as a source for images.
Summary
Constructors
Properties
Methods
- fromAsset
- fromAsset
- fromBase64
- fromBase64
- fromBase64Sync
- fromData
- fromData
- fromDataSync
- fromFile
- fromFile
- fromFileOrResourceSync
- fromFileSync
- fromFontIconCodeSync
- fromResource
- fromResource
- fromResourceSync
- fromUrl
- loadFromBase64
- loadFromData
- loadFromFile
- loadFromFontIconCode
- loadFromResource
- resize
- resizeAsync
- saveToFile
- saveToFileAsync
- setNativeSource
- toBase64String
- toBase64StringAsync
Constructors
constructor
new ImageSource(nativeSource?: any): ImageSource
Creates a new ImageSource instance and sets the provided native source object (typically a Bitmap).
The native source object will update either the android or ios properties, depending on the target os.
Returns ImageSource
Properties
android
The Android-specific [image](http://developer.android.com/reference/android/graphics/Bitmap.html) instance. Will be undefined when running on iOS.
height
Gets the height of this instance. This is a read-only property.
ios
The iOS-specific [UIImage](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/) instance. Will be undefined when running on Android.
rotationAngle
Gets or sets the rotation angle that should be applied to the image. (Used in android)
width
Gets the width of this instance. This is a read-only property.
Methods
fromAsset
fromAsset(asset: ImageAsset): Promise<ImageSource>
fromBase64
fromData
fromFile
fromResource
loadFromBase64
loadFromData
loadFromFile
loadFromFontIconCode
loadFromResource
resize
resize(maxSize: number, options?: any): ImageSource
Returns a new ImageSource that is a resized version of this image with the same aspect ratio, but the max dimension set to the provided maxSize.
Returns ImageSource
resizeAsync
resizeAsync(maxSize: number, options?: any): Promise<ImageSource>
Returns a new ImageSource that is a resized version of this image with the same aspect ratio, but the max dimension set to the provided maxSize asynchronously.
Returns Promise<ImageSource>
saveToFile
Saves this instance to the specified file, using the provided image format and quality.
Returns boolean
saveToFileAsync
setNativeSource
Sets the provided native source object (typically a Bitmap or a UIImage).
This will update either the android or ios properties, depending on the target os.
Returns void
toBase64String
Converts the image to base64 encoded string, using the provided image format and quality.
Returns string
toBase64StringAsync
Converts the image to base64 encoded string, using the provided image format and quality asynchronously.
Returns Promise<string>
fromAsset
Static
fromAsset(asset: ImageAsset): Promise<ImageSource>
fromBase64
Static
fromBase64(source: string): Promise<ImageSource>
Loads this instance from the specified base64 encoded string asynchronously.
Returns Promise<ImageSource>
fromBase64Sync
Static
fromBase64Sync(source: string): ImageSource
fromData
Static
fromData(data: any): Promise<ImageSource>
Loads this instance from the specified native image data asynchronously.
Returns Promise<ImageSource>
fromDataSync
Static
fromDataSync(data: any): ImageSource
fromFile
Static
fromFile(path: string): Promise<ImageSource>
fromFileOrResourceSync
Static
fromFileOrResourceSync(path: string): ImageSource
Creates a new ImageSource instance and loads it from the specified local file or resource (if specified with the "res://" prefix).
Returns ImageSource
fromFileSync
Static
fromFileSync(path: string): ImageSource
fromFontIconCodeSync
Static
fromFontIconCodeSync(source: string, font: Font, color: Color): ImageSource
Creates a new ImageSource instance and loads it from the specified font icon code.
Returns ImageSource
fromResource
Static
fromResource(name: string): Promise<ImageSource>
fromResourceSync
Static
fromResourceSync(name: string): ImageSource
fromUrl
Static
fromUrl(url: string): Promise<ImageSource>
Downloads the image from the provided Url and creates a new ImageSource instance from it.
Returns Promise<ImageSource>
- Previous
- ImageCache
- Next
- InheritedCssProperty