From 756781fafc3c435efb1884efa378fef149c76fc6 Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Sat, 12 Oct 2024 15:19:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[testpicture]=E4=BF=AE=E6=94=B9=E5=A4=96?= =?UTF-8?q?=E6=8E=A5=E7=BA=B9=E7=90=86=E5=9B=BE=E7=89=87=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AD=98=E6=B3=84=E9=9C=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hezhengyi --- .../ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets b/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets index 8b8a83af..75723c9a 100644 --- a/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets +++ b/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets @@ -27,7 +27,6 @@ export class PicturePlugin implements FlutterPlugin, MethodCallHandler { private binding: FlutterPluginBinding | null = null; private mMethodChannel: MethodChannel | null = null; private textureRegistry: TextureRegistry | null = null; - private fileData: Uint8Array | null = null; private pixelMapCache: HashMap = new HashMap(); getUniqueClassName(): string { @@ -67,8 +66,8 @@ export class PicturePlugin implements FlutterPlugin, MethodCallHandler { } async registerPicturePixMap(pictureName: string) { - this.fileData = await this.binding!.getApplicationContext().resourceManager.getRawFileContent(pictureName); - let buffer : ArrayBuffer = this.fileData?.buffer as ArrayBuffer ?? new ArrayBuffer(0); + let fileData = await this.binding!.getApplicationContext().resourceManager.getRawFileContent(pictureName); + let buffer : ArrayBuffer = fileData?.buffer as ArrayBuffer ?? new ArrayBuffer(0); let imageSource : image.ImageSource = image.createImageSource(buffer); let imageInfo = await imageSource.getImageInfo(); Log.d(TAG, "ImageHeight " + imageInfo.size.height); -- Gitee From d82c4cfe9ee1fe0768a423c44642cc5cd668a95e Mon Sep 17 00:00:00 2001 From: hezhengyi Date: Tue, 15 Oct 2024 11:10:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hezhengyi --- .../ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets b/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets index 75723c9a..47786d78 100644 --- a/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets +++ b/ohos/testpicture/ohos/entry/src/main/ets/pictureplugin/PicturePlugin.ets @@ -66,7 +66,7 @@ export class PicturePlugin implements FlutterPlugin, MethodCallHandler { } async registerPicturePixMap(pictureName: string) { - let fileData = await this.binding!.getApplicationContext().resourceManager.getRawFileContent(pictureName); + let fileData = await this.binding!.getApplicationContext().resourceManager.getRawFileContent(pictureName); let buffer : ArrayBuffer = fileData?.buffer as ArrayBuffer ?? new ArrayBuffer(0); let imageSource : image.ImageSource = image.createImageSource(buffer); let imageInfo = await imageSource.getImageInfo(); -- Gitee