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 8b8a83af959fffe5e9012f268227f979a3ec124d..47786d7855bf383d59547f9763f657393cccbf44 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);