diff --git a/README.md b/README.md index 5641fc7..7d33085 100644 --- a/README.md +++ b/README.md @@ -264,36 +264,6 @@ ImageKnifeAnimatorComponent({ },animatorOption:this.animatorOption }).width(300).height(300).backgroundColor(Color.Orange).margin({top:30}) ``` - -#### 11.加载图片回调信息数据 示例 -``` -ImageKnifeComponent({ ImageKnifeOption: = new ImageKnifeOption({ - loadSrc: $r('app.media.pngSample'), - objectFit: ImageFit.Contain, - onLoadListener: { - onLoadStart: (req) => { - let startCallBackData = JSON.stringify(req?.getImageKnifeData()); - }, - onLoadFailed: (res, req) => { - let failedBackData = res + ";" + JSON.stringify(req?.getImageKnifeData()); - }, - onLoadSuccess: (data, imageData, req) => { - let successBackData = JSON.stringify(req?.getImageKnifeData()); - }, - onLoadCancel: (res, req) => { - let cancelBackData = res + ";" + JSON.stringify(req?.getImageKnifeData()); - } - }, - border: { radius: 50 }, - onComplete: (event) => { - if (event && event.loadingStatus == 0) { - let render_success = JSON.stringify(Date.now()) - } - } - }) -}).width(100).height(100) -``` - #### Reuse Scenario Clear the component content in the **aboutToRecycle** lifecycle and trigger image loading through watch observeration. ## Available APIs @@ -337,7 +307,7 @@ Clear the component content in the **aboutToRecycle** lifecycle and trigger imag | transformation | PixelMapTransformation | Image transformation. Optional. | | drawingColorFilter | ColorFilter | Drawing color filter. Optional. | | onComplete | (event:EventImage \| undefined)=>void | Callback for image loading completion. Optional. | -| onLoadListener | onLoadStart?: (req?: ImageKnifeRequest) => void,onLoadSuccess?: (data: string \| PixelMap \| undefined, imageData: ImageKnifeData, req?: ImageKnifeRequest) => void,onLoadFailed?: (err: string, req?: ImageKnifeRequest) => void,onLoadCancel?: (res: string, req?: ImageKnifeRequest) => void | Callback for image loading events. Optional. | +| onLoadListener | onLoadStart:()=>void,onLoadSuccess:(data:string\|Pixelmap)=>void | Callback for image loading events. Optional. | ### ImageKnife @@ -355,19 +325,6 @@ Clear the component content in the **aboutToRecycle** lifecycle and trigger imag | putCacheImage | url: string, pixelMap: PixelMap, cacheType: CacheStrategy = CacheStrategy.Default, signature?: string | Writes to the memory disk cache. | | removeMemoryCache | url: string | Removes an entry from the memory cache. | | removeFileCache | url: string | Removes an entry from the file cache. | -| getCurrentCacheNum | cacheType?: CacheStrategy | 获取指定缓存的当前缓存图片个数 | -| getCurrentCacheSize | cacheType?: CacheStrategy | 获取指定缓存的当前大小 | -| getCurrentCacheSize | cacheType?: CacheStrategy | 获取指定缓存的当前大小 | - - -### 回调接口说明 -| 回调接口 | 回调字段 | 回调描述 | -|----------------|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| onLoadStart | req: ImageKnifeRequest | req返回字段中包含了图片请求的信息,如图片的url及其组件的宽高,同时ImageKnifeRequest包含了ImageKnifeData,其中包含此次请求的开始及其检查内存缓存的时间点 | -| onLoadSuccess | data: string \| PixelMap \| undefined, imageData: ImageKnifeData, req?: ImageKnifeRequest | data:加载成功的结果数据;imageData:图片的存入缓存中的信息 ,req:图片请求的信息,同时其中的ImageKnifeData,包含此次请求中图片的原始大小、图片的解码大小、格式、图片帧、请求结束时间、磁盘检查时间、网络请求开始结束、图片解码开始结束等时间点 | -| onLoadFailed | err: string, req?: ImageKnifeRequest | err:错误信息描述;req:图片请求的信息,同时其中的ImageKnifeData,包含此次请求错误信息(ErrorInfo,TimeInfo),ErrorInfo其中包含了,错误阶段、错误码及其网络请求的错误码;TimeInfo中包含请求结束时间、磁盘检查时间、网络请求开始结束、图片解码开始结束等时间点 | -| onLoadCancel | reason: string, req?: ImageKnifeRequest | reason:取消回调原因;req:图片请求的信息,同时其中的ImageKnifeData,包含此次请求错误信息(ErrorInfo,TimeInfo),ErrorInfo其中包含了,错误阶段、错误码及其网络请求的错误码;TimeInfo中包含请求结束时间、磁盘检查时间、网络请求开始结束、图片解码开始结束及其请求取消等时间点 | - ### Graphics tRansformation Types (GPUImage Dependency Required) | Type | Description | @@ -415,4 +372,4 @@ This project is licensed under [Apache License 2.0](https://gitee.com/openharmon ## Known Issues - The **ImageFit** attribute cannot be set for the **ImageKnifeAnimator** component. -- The **border** attribute of the **ImageKnifeAnimator** component cannot make the image rounded corners. +- The **border** attribute of the **ImageKnifeAnimator** component cannot make the image rounded corners. \ No newline at end of file