mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
async load of images in web client + loadFromBitmap for Image
This commit is contained in:
@@ -37,6 +37,11 @@ export module tk {
|
||||
return (this._nativeImage != null);
|
||||
}
|
||||
|
||||
public loadFromBitmap(source: any): boolean {
|
||||
this._nativeImage = source;
|
||||
return (this._nativeImage != null);
|
||||
}
|
||||
|
||||
public saveToFile(path: string, format: ImageType, quality?: number): boolean {
|
||||
if (this._nativeImage) {
|
||||
var targetFormat = android.graphics.Bitmap.CompressFormat.PNG;
|
||||
|
||||
1
Image/image.d.ts
vendored
1
Image/image.d.ts
vendored
@@ -9,6 +9,7 @@
|
||||
loadFromResource(name: string): boolean;
|
||||
loadFromFile(path: string): boolean;
|
||||
loadFromData(data: any): boolean;
|
||||
loadFromBitmap(source: any): boolean;
|
||||
saveToFile(path: string, format: ImageType, quality?: number): boolean;
|
||||
|
||||
getHeight(): number;
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
return (this._nativeImage != null);
|
||||
}
|
||||
|
||||
public loadFromBitmap(source: any): boolean {
|
||||
this._nativeImage = source;
|
||||
return (this._nativeImage != null);
|
||||
}
|
||||
|
||||
public saveToFile(path: string, format: ImageType, quality?: number): boolean {
|
||||
if (null == this._nativeImage) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user