Readonly
iosReadonly
androidReadonly
heightGets the height of image in pixels.
0.1
Readonly
widthGets 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
Returns a Blob instance.
toBlob
Blob
0.1
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.
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 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 }Generated using TypeDoc
Since
0.1
Image is used to store the image data read from the filesystem. It can be set to UI objects' properties (e.g. UI.ImageView.image).
Example