feat:Image add pixel API,pass pixels directly to Image
This commit is contained in:
14
doric-js/lib/src/widget/image.d.ts
vendored
14
doric-js/lib/src/widget/image.d.ts
vendored
@@ -8,6 +8,14 @@ export declare enum ScaleType {
|
||||
ScaleAspectFill = 2
|
||||
}
|
||||
export declare class Image extends View {
|
||||
/**
|
||||
* Set pixels for image directly
|
||||
*/
|
||||
imagePixels?: {
|
||||
width: number;
|
||||
height: number;
|
||||
pixels: ArrayBuffer;
|
||||
};
|
||||
/**
|
||||
* This could be loaded by customized resource loader
|
||||
*/
|
||||
@@ -81,5 +89,11 @@ export declare class Image extends View {
|
||||
isAnimating(context: BridgeContext): Promise<boolean>;
|
||||
startAnimating(context: BridgeContext): Promise<any>;
|
||||
stopAnimating(context: BridgeContext): Promise<any>;
|
||||
getImageInfo(context: BridgeContext): Promise<{
|
||||
width: number;
|
||||
height: number;
|
||||
mimeType: string;
|
||||
}>;
|
||||
getImagePixels(context: BridgeContext): Promise<ArrayBuffer>;
|
||||
}
|
||||
export declare function image(config: Partial<Image>): Image;
|
||||
|
@@ -42,7 +42,17 @@ export class Image extends View {
|
||||
stopAnimating(context) {
|
||||
return this.nativeChannel(context, "stopAnimating")();
|
||||
}
|
||||
getImageInfo(context) {
|
||||
return this.nativeChannel(context, "getImageInfo")();
|
||||
}
|
||||
getImagePixels(context) {
|
||||
return this.nativeChannel(context, "getImagePixels")();
|
||||
}
|
||||
}
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Object)
|
||||
], Image.prototype, "imagePixels", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Resource)
|
||||
|
Reference in New Issue
Block a user