From 549d9edf48644eb3052420430a6a62471287c8cd Mon Sep 17 00:00:00 2001 From: madixin Date: Sat, 14 Dec 2024 12:14:30 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E9=A1=B5=E9=9D=A2=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=92=8C=E6=B5=8B=E8=AF=95local=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=9A=84=E6=98=BE=E7=A4=BA=EF=BC=8C=E7=9B=AE?= =?UTF-8?q?=E5=89=8D=E5=8F=91=E7=8E=B0rawfile=E4=B8=8B=E7=9A=84=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=202.httpRequestOp?= =?UTF-8?q?tion=20--=E3=80=8B=20HttpRequestOption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: madixin --- README_zh.md | 2 +- entry/src/main/ets/pages/Index.ets | 6 + entry/src/main/ets/pages/LocalImage.ets | 78 ++++ .../main/resources/base/element/string.json | 20 + .../resources/base/profile/main_pages.json | 3 +- .../main/resources/en_US/element/string.json | 380 ------------------ .../resources/rawfile/image/startIcon.png | Bin 0 -> 4351 bytes .../main/resources/zh_CN/element/string.json | 18 +- library/index.ets | 5 +- .../src/main/ets/model/ImageKnifeOption.ets | 4 +- sharedlibrary/Index.ets | 2 +- 11 files changed, 131 insertions(+), 387 deletions(-) create mode 100644 entry/src/main/ets/pages/LocalImage.ets delete mode 100644 entry/src/main/resources/en_US/element/string.json create mode 100644 entry/src/main/resources/rawfile/image/startIcon.png diff --git a/README_zh.md b/README_zh.md index eaec8d0..a15d2bd 100644 --- a/README_zh.md +++ b/README_zh.md @@ -377,7 +377,7 @@ async function custom(context: Context, src: string | PixelMap | Resource,header | onComplete | (event:EventImage、undefined) => void | 图片成功回调事件(可选) | | 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 | 监听图片加载成功与失败 | | downsampleOf | DownsampleStrategy | 降采样(可选) | -| httpOption | httpRequestOption | 网络请求配置(可选) | +| httpOption | HttpRequestOption | 网络请求配置(可选) | ### 降采样类型 | 类型 | 相关描述 | diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 664eb38..b3ab212 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -82,6 +82,12 @@ struct Index { }); }) + Button($r('app.string.Test_LocalImageShow')).margin({top:10}).onClick(()=>{ + router.push({ + uri: 'pages/LocalImage', + + }); + }) Button($r('app.string.Test_custom_download')).margin({top:10}).onClick(()=>{ router.push({ uri: 'pages/TestSetCustomImagePage', diff --git a/entry/src/main/ets/pages/LocalImage.ets b/entry/src/main/ets/pages/LocalImage.ets new file mode 100644 index 0000000..bd8e8df --- /dev/null +++ b/entry/src/main/ets/pages/LocalImage.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { ImageKnifeComponent } from '@ohos/libraryimageknife'; +import fs from '@ohos.file.fs'; + +@Entry +@Component +struct LocalImage { + scroller: Scroller = new Scroller; + localFile: string = getContext(this).filesDir + '/icon.png' + + aboutToAppear(): void { + // 拷贝本地文件 + let icon: Uint8Array = getContext(this).resourceManager.getMediaContentSync($r('app.media.startIcon')); + let file = fs.openSync(this.localFile, fs.OpenMode.CREATE | fs.OpenMode.READ_WRITE); + fs.writeSync(file.fd, icon.buffer); + fs.fsyncSync(file.fd); + fs.closeSync(file); + } + + build() { + Scroll(this.scroller) { + Column() { + Text($r('app.string.local_r_file')) + .fontSize(30) + .fontWeight(FontWeight.Bold) + ImageKnifeComponent({ + imageKnifeOption: { + loadSrc: $r('app.media.startIcon'), + objectFit: ImageFit.Contain + } + }).width(100).height(100) + Text($r('app.string.local_rawfile')) + .fontSize(30) + .fontWeight(FontWeight.Bold) + ImageKnifeComponent({ + imageKnifeOption: { + loadSrc: $rawfile('image/startIcon.png'), + objectFit: ImageFit.Contain + } + }).width(100).height(100) + Text($r('app.string.Under_context_file')) + .fontSize(30) + .fontWeight(FontWeight.Bold) + ImageKnifeComponent({ + imageKnifeOption: { + loadSrc: this.localFile, + objectFit: ImageFit.Contain + } + }).width(100).height(100) + Text($r('app.string.local_other_module')) + .fontSize(30) + .fontWeight(FontWeight.Bold) + ImageKnifeComponent({ + imageKnifeOption: { + loadSrc: $r('[sharedlibrary].media.startIcon'), + objectFit: ImageFit.Contain + } + }).width(100).height(100) + } + .width('100%') + } + .height('100%') + } +} + diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index b246b61..ed78ad0 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -40,6 +40,10 @@ "name": "Test_SingleImage", "value": "SingleImage" }, + { + "name": "Test_LocalImageShow", + "value": "LocalImageShow" + }, { "name": "Test_custom_download", "value": "Global custom download" @@ -140,10 +144,26 @@ "name": "Local_SVG", "value": "Local SVG image" }, + { + "name": "local_r_file", + "value": "Local $r file" + }, + { + "name": "local_rawfile", + "value": "Local rawfile" + }, { "name": "Under_context_file", "value": "Files under context file" }, + { + "name": "local_other_module", + "value": "Local other module" + }, + { + "name": "in_other_module", + "value": "in other module" + }, { "name": "Network_images", "value": "Network images" diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json index c8be797..54d8b21 100644 --- a/entry/src/main/resources/base/profile/main_pages.json +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -40,6 +40,7 @@ "pages/DownSamplePage", "pages/AutoImageFit", "pages/SingleImageCallBack", - "pages/MultipleImageCallBack" + "pages/MultipleImageCallBack", + "pages/LocalImage" ] } \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index 4d62c27..0000000 --- a/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,380 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "app_permission_WRITE_IMAGEVIDEO", - "value": "获取写入媒体资源权限" - }, - { - "name": "app_permission_READ_IMAGEVIDEO", - "value": "获取读媒体资源权限" - }, - { - "name": "Test_ImageAnimator", - "value": "Test ImageAnimator component" - }, - { - "name": "Test_multiple_images", - "value": "Test loading multiple identical images" - }, - { - "name": "Test_Task_error", - "value": "Test placeholder map Task error" - }, - { - "name": "Test_HSP", - "value": "Test HSP scene preloading" - }, - { - "name": "Test_SingleImage", - "value": "SingleImage" - }, - { - "name": "Test_custom_download", - "value": "Global custom download" - }, - { - "name": "Multiple_images", - "value": "Multiple images" - }, - { - "name": "Display_long_image", - "value": "Display long image" - }, - { - "name": "Image_scaling", - "value": "Image scaling" - }, - { - "name": "Message_list", - "value": "Message list" - }, - { - "name": "Custom_cache_key", - "value": "Custom cache key" - }, - { - "name": "Preloading_images_to_cache", - "value": "Preloading images to file cache" - }, - { - "name": "Retrieve_image_display_from_cache", - "value": "Retrieve image display from cache" - }, - { - "name": "Test_single_request_header", - "value": "Test a single request header" - }, - { - "name": "Test_write_cache_strategy", - "value": "Test write cache strategy" - }, - { - "name": "Image_Transformation", - "value": "Image Transformation" - }, - { - "name": "Different_ObjectFit", - "value": "Different ObjectFit" - }, - { - "name": "Test_image_loading_success_or_failure_events", - "value": "Test image loading success/failure events" - }, - { - "name": "Test_removing_image_cache_interface", - "value": "Test removing image cache interface" - }, - { - "name": "Test_error_image_display", - "value": "Test error image display" - }, - { - "name": "Test_media_URL", - "value": "Test media URL" - }, - { - "name": "Display_the_first_frame", - "value": "Display the first frame of the animation" - }, - { - "name": "Display_the_last_frame", - "value": "Display the last frame of the animation" - }, - { - "name": "Play", - "value": "Play" - }, - { - "name": "Pause", - "value": "Pause" - }, - { - "name": "Stop", - "value": "Stop" - }, - { - "name": "Infinite_loop", - "value": "Infinite loop" - }, - { - "name": "Play_once", - "value": "Play once" - }, - { - "name": "Play_twice", - "value": "Play twice" - }, - { - "name": "Local_SVG", - "value": "Local SVG image" - }, - { - "name": "Under_context_file", - "value": "Files under context file" - }, - { - "name": "Network_images", - "value": "Network images" - }, - { - "name": "Custom_network_download", - "value": "Custom network download" - }, - { - "name": "PixelMap_loads_images", - "value": "PixelMap loads images" - }, - { - "name": "Enlarge", - "value": "Enlarge" - }, - { - "name": "Reduce", - "value": "Reduce" - }, - { - "name": "Click_on_add", - "value": "Click on the size to add 50" - }, - { - "name": "Click_on_reduce", - "value": "Click to reduce size by 50" - }, - { - "name": "The_key_fixed_1", - "value": "The key is fixed at 1" - }, - { - "name": "The_key_changes_timestamp", - "value": "Key changes every time: timestamp" - }, - { - "name": "Load", - "value": "Load" - }, - { - "name": "Preloading_images_to_file_cache_using_URL", - "value": "Preloading images to file cache using URL" - }, - { - "name": "Preloading_images_to_file_cache_using_option", - "value": "Preloading images to file cache using option" - }, - { - "name": "Load_image_offline_after_preloading", - "value": "Load image (can be loaded offline after preloading)" - }, - { - "name": "Preloading_GIF", - "value": "Preloading GIF" - }, - { - "name": "Retrieve_GIF_from_memory", - "value": "Retrieve GIF from memory cache" - }, - { - "name": "Retrieve_GIF_from_disk", - "value": "Retrieve GIF from disk cache" - }, - { - "name": "Preloading_static_images", - "value": "Preloading static images" - }, - { - "name": "Retrieve_images_from_memory", - "value": "Retrieve images from memory cache" - }, - { - "name": "Retrieve_images_from_disk", - "value": "Retrieve images from memory disk" - }, - { - "name": "Write_memory_and_file", - "value": "Write to memory and file cache" - }, - { - "name": "Write_memory", - "value": "Write to memory cache" - }, - { - "name": "Write_file", - "value": "Write to file cache" - }, - { - "name": "Main_image_Fill", - "value": "Main image Fill Stretch Fill" - }, - { - "name": "Maintain_proportion_filling", - "value": "Maintain proportion filling in the placeholder map 'Include'" - }, - { - "name": "Error_graph_None", - "value": "Error graph None remains unchanged" - }, - { - "name": "Test_failure_success", - "value": "Test failure/success" - }, - { - "name": "Custom_download_failed", - "value": "Custom download failed" - }, - { - "name": "Retrieve_media_gallery", - "value": "Retrieve the URI of the media gallery and display it using ImageKnife" - }, - { - "name": "Click_load_Uri", - "value": "Click to load Uri and display" - }, - { - "name": "Delete_all_caches", - "value": "Delete all caches" - }, - { - "name": "Delete_all_memory_caches", - "value": "Delete all memory caches" - }, - { - "name": "Delete_all_file_caches", - "value": "Delete all file caches" - }, - { - "name": "Delete_all_custom_memory_caches", - "value": "Delete all custom memory caches" - }, - { - "name": "Delete_all_custom_file_caches", - "value": "Delete all custom file caches" - }, - { - "name": "Blur_effect", - "value": "Blur effect" - }, - { - "name": "Highlighting_effect", - "value": "Highlighting effect" - }, - { - "name": "Ashing_effect", - "value": "Ashing effect" - }, - { - "name": "Inverse_effect", - "value": "Inverse effect" - }, - { - "name": "Animation_filter_effect", - "value": "Animation filter effect" - }, - { - "name": "Crop_circular_effect", - "value": "Crop circular effect" - }, - { - "name": "Crop_circular_with_border_effect", - "value": "Crop circular with border effect" - }, - { - "name": "Contrast_effect", - "value": "Contrast effect" - }, - { - "name": "Black_ink_filtering_effect", - "value": "Black ink filtering effect" - }, - { - "name": "Rotate", - "value": "Rotate" - }, - { - "name": "Corners", - "value": "Corners" - }, - { - "name": "Kuwahara_Filter_effect", - "value": "Kuwahara filter effect" - }, - { - "name": "Pixelated_Filter_effect", - "value": "Pixelated filtering effect" - }, - { - "name": "Sketch_Filter_effect", - "value": "Sketch Filter effect" - }, - { - "name": "Distortion_Filter_effect", - "value": "Distortion Filter effect" - }, - { - "name": "Decorative_Filter_effect", - "value": "Decorative Filter effect" - }, - { - "name": "Square_cutting_effect", - "value": "Square cutting effect" - }, - { - "name": "Top_cutting_effect", - "value": "Top cutting effect" - }, - { - "name": "Middle_cutting_effect", - "value": "Middle cutting effect" - }, - { - "name": "Bottom_cutting_effect", - "value": "Bottom cutting effect" - }, - { - "name": "Mask_effect", - "value": "Mask effect" - }, - { - "name": "TIPS", - "value": "Please shut down the network first and ensure that there is no cache of images from this network in the test failure scenario locally" - }, - { - "name": "Network_reload", - "value": "Network recovery reload" - }, - { - "name": "preloading_prefetch", - "value": "Dynamic preloading prefetch" - } - ] -} \ No newline at end of file diff --git a/entry/src/main/resources/rawfile/image/startIcon.png b/entry/src/main/resources/rawfile/image/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..366f76459ffd4494ec40d0ddd5c59385b9c5da11 GIT binary patch literal 4351 zcmaJ_c{r5o`$trELZWDz?8}%L>x?yK$i9!UFJmyqEM`W=l13t1vK18?bc9Hft+FQB zvZWA7vQ{XHEY)wEb2{JOAK&wRuj_rE=e@7{{@mN=ey`_xlk9BF_<1CG*x1mL!?jn!jg+b4^2 zLetRJR&Wf70P@|_0nrI$mNgrjo*|v=i@{@Q06%OXj;Ie@ebfR3;QaN0E}GV0YqAM8 z2zNS?f_03val%C6F))9ip#eaT4rc)nuryx)oe)B#!s+_JKXKu#{hnA22>4TlhSvxF z6%^Xq4q!r}U;$bnuqp-&)&gk5KoBhrZB2C*02B;`sDYts5KUDG1g;5%L(~C(UqF^O zihlsy0b%;LFV>qrFo;GY!`0Nn!^1)0>L3y&Pz?fu!S*nqP*s+ODm8*g^QEg2sV9FU zAh1*n1xKdgNJPLMqOTt*jHVA{Mfz6?1oA(yMC#vVViin{?n_pKfWUhx{Z_QL{@IO$Y>u zG)8K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$S8>M{G2rp&``kF_`$@W znJEtXUEg`=h&$@gYgOjNQzv=Uk}&Ls(m6u%F4L`YyePS3oL4jqq0<~BnXmrUq_SE|?M~j!BdLw~HoaTstBb7=HK+WcPWE@_ cIQZCt9|&h0`tm_w@0Wx*(gtzY*ysHJ0mylrOaK4? literal 0 HcmV?d00001 diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index cea7589..35f0c99 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -40,6 +40,10 @@ "name": "Test_SingleImage", "value": "单个图片使用" }, + { + "name": "Test_LocalImageShow", + "value": "本地图片显示" + }, { "name": "Test_custom_download", "value": "全局自定义下载" @@ -136,9 +140,21 @@ "name": "Local_SVG", "value": "本地资源SVG图片" }, + { + "name": "local_r_file", + "value": "本地$r文件" + }, + { + "name": "local_rawfile", + "value": "本地rawfile文件" + }, { "name": "Under_context_file", - "value": "本地context files下文件" + "value": "本地沙箱路径文件" + }, + { + "name": "local_other_module", + "value": "本地其他模块文件" }, { "name": "Network_images", diff --git a/library/index.ets b/library/index.ets index 28fc8d8..65d243d 100644 --- a/library/index.ets +++ b/library/index.ets @@ -18,7 +18,10 @@ export { ImageKnifeAnimatorComponent } from './src/main/ets/components/ImageKnif export { ImageKnife } from './src/main/ets/ImageKnife' -export { ImageKnifeOption , AnimatorOption,httpRequestOption,HeaderOptions } from './src/main/ets/model/ImageKnifeOption' +export { ImageKnifeOption, + AnimatorOption, + HttpRequestOption, + HeaderOptions } from './src/main/ets/model/ImageKnifeOption' export { ImageKnifeRequest } from './src/main/ets/model/ImageKnifeRequest' diff --git a/library/src/main/ets/model/ImageKnifeOption.ets b/library/src/main/ets/model/ImageKnifeOption.ets index 2c1ba36..00f63ba 100644 --- a/library/src/main/ets/model/ImageKnifeOption.ets +++ b/library/src/main/ets/model/ImageKnifeOption.ets @@ -45,7 +45,7 @@ export class AnimatorOption { onRepeat?:()=>void } -export interface httpRequestOption { +export interface HttpRequestOption { caPath?: string // 自定义证书路径 connectTimeout?: number // 连接超时 readTimeout?: number // 读取超时 @@ -82,7 +82,7 @@ export class ImageKnifeOption { drawingColorFilter?: ColorFilter | drawing.ColorFilter downsampleOf?: DownsampleStrategy // 降采样 // 自定义证书路径 - httpOption?: httpRequestOption + httpOption?: HttpRequestOption constructor() { } diff --git a/sharedlibrary/Index.ets b/sharedlibrary/Index.ets index d426419..f5243ad 100644 --- a/sharedlibrary/Index.ets +++ b/sharedlibrary/Index.ets @@ -22,7 +22,7 @@ export { ImageKnifeComponent,ImageKnifeAnimatorComponent } from '@ohos/imageknif export { ImageKnife } from '@ohos/imageknife' -export { ImageKnifeOption,AnimatorOption,httpRequestOption,HeaderOptions } from '@ohos/imageknife' +export { ImageKnifeOption, AnimatorOption, HttpRequestOption, HeaderOptions } from '@ohos/imageknife' export { DownsampleStrategy } from "@ohos/imageknife"