Abstract
Protected
_nativeStatic
androidCreates rounded image of given systemicon
createSystemIcon
https://developer.android.com/reference/android/R.drawable
4.0.2
Creates an Image object which built-in icon is created corresponding systemIcon value. This method is Android only.
createSystemIcon
https://developer.android.com/reference/android/R.drawable
4.0.2
Static
FormatStatic
Readonly
iOSiOS Specific Properties.
3.1.3
Gets the height of image in pixels.
0.1
Gets the width of image in pixels.
0.1
Gets/Sets the autoMirrored of image. This property sets direction of Image automatically related to system or application direction.
3.1.3
Gets/Sets the autoMirrored of image. This property sets direction of Image automatically related to system or application direction.
3.1.3
Protected
preProtected
addProtected
addIOSPropsReturns a compressed blob from existing image with given quality. onSuccess and onFailure are optional parameters.
import Image from '@smartface/native/ui/image';
var myImage = Image.createFromFile("images://smartface.png")
var myBlob = myImage.compress(Image.Format.JPEG, 50);
var myCompressedImage = Image.createFromBlob(myBlob);
compress
Blob
0.1
Image format.
Image quality is between 0 and 100.
Optional
onSuccess: ((e: { blob: IBlob<any, MobileOSProps<{}, IBlobAndroidProps>> }) => void)Callback for success situation.
Optional
onFailure: ((e?: { message: string }) => void)Callback for failure situation.
Optional
e: { message: string }Returns a rotated image with given angle. Rotate direction is clockwise and angle is between 0-360. onSuccess and onFailure are optional parameters.
rotate
UI.Image
0.1
The angle value of the rectangle top-left corner.
Optional
onSuccess: ((e: { image: IImage<any, MobileOSProps<ImageIOSProps, ImageAndroidProps>> }) => void)Callback for success situation.
Optional
onFailure: ((e?: { message: string }) => void)Callback for failure situation.
Optional
e: { message: string }Creates a new image from existing image with specified width and height. onSuccess and onFailure are optional parameters.
import Image from '@smartface/native/ui/image';
import ImageView from '@smartface/native/ui/imageview';
var myImage = Image.createFromFile("images://smartface.png")
var myImageView = new ImageView();
myImageView.image = myImage.resize(myImage.width/2, myImage.height/2); // resize example without callback
import Image from '@smartface/native/ui/image';
import ImageView from '@smartface/native/ui/imageview';
var myImage = Image.createFromFile("images://smartface.png")
var myImageView = new ImageView();
myImage.resize(myImage.width/2, myImage.height/2, onSuccess);
function onSuccess(e) {
myImageView.image = e.image
}
resize
UI.Image
0.1
Width pixels of the new bitmap.
Height pixels of the new bitmap.
Optional
onSuccess: ((e: { image: IImage<any, MobileOSProps<ImageIOSProps, ImageAndroidProps>> }) => void)Callback for success situation.
Optional
onFailure: ((e?: { message: string }) => void)Callback for failure situation.
Optional
e: { message: string }Returns a cropped image from existing image with specified rectangle. onSuccess and onFailure are optional parameters.
crop
UI.Image
0.1
The x pixels of the rectangle top-left corner.
The y pixels of the rectangle top-left corner.
Width pixels of the new bitmap.
Height pixels of the new bitmap.
Callback for success situation.
Callback for failure situation.
Optional
e: { message: string }Returns a Blob instance.
toBlob
Blob
0.1
Static
createCreates an image object from given a blob.
createFromBlob
UI.Image
0.1
Contains image datas.
Static
createUsed privately inside framework Creates an image object from image.nativeobject.
createFromImage
UI.Image
0.1
Contains image datas.
Static
createUsed privately inside framework Creates an image object from file path or image.
createImageFromPath
UI.Image
0.1
Contains image datas.
Static
createCreates a rounded image object from given path. This method works for only Android. It returns undefined for iOS.
createRoundedImage
UI.Image
2.0.10
Image path
Optional
radius?: numberImage corner radius
Static
createCreates an Image instance from given file path. Large bitmap loading causes OutOfMemory exception on Android. width and height parameters works for only Android. No-op for iOS. These parameters are used loading large bitmaps efficiently. If you pass these parameters, the bitmap will scaled down.
import Image from '@smartface/native/ui/image';
var myImage = Image.createFromFile("images://smartface.png");
createFromFile
An Image instance.
0.1
https://developer.android.com/topic/performance/graphics/load-bitmap.html
Image file path
Optional
width: numberWidth in pixels
Optional
height: numberHeight in pixels
Protected
createOptional
params: ImageParamsGenerated using TypeDoc
Since
4.5.0