{"id":89443,"date":"2026-08-03T02:56:30","date_gmt":"2026-08-02T18:56:30","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/89443.html"},"modified":"2026-08-03T02:56:30","modified_gmt":"2026-08-02T18:56:30","slug":"harmonyos-photoaccesshelper-%e7%9b%b8%e5%86%8c%e5%bc%80%e5%8f%91%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/89443.html","title":{"rendered":"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218"},"content":{"rendered":"<h2>\u4e00\u3001HarmonyOS NEXT \u76f8\u518c\u5f00\u53d1\u4f53\u7cfb\u6982\u8ff0<\/h2>\n<p>\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d&#xff0c;\u76f8\u518c\u80fd\u529b\u51e0\u4e4e\u662f\u6240\u6709\u56fe\u7247\u7c7b\u5e94\u7528\u7684\u57fa\u7840\u80fd\u529b\u3002<\/p>\n<p>\u65e0\u8bba\u662f&#xff1a;<\/p>\n<ul>\n<li>\u793e\u4ea4\u5e94\u7528\u4e0a\u4f20\u5934\u50cf<\/li>\n<li>\u7535\u5546\u5e94\u7528\u4e0a\u4f20\u5546\u54c1\u56fe\u7247<\/li>\n<li>\u56fe\u7247\u7f16\u8f91\u5668\u9009\u62e9\u7d20\u6750<\/li>\n<li>\u4e91\u76f8\u518c\u540c\u6b65\u7167\u7247<\/li>\n<li>\u77ed\u89c6\u9891\u5e94\u7528\u9009\u62e9\u89c6\u9891<\/li>\n<li>\u626b\u63cf\u5e94\u7528\u8bfb\u53d6\u56fe\u7247<\/li>\n<\/ul>\n<p>\u90fd\u9700\u8981\u8bbf\u95ee\u7cfb\u7edf\u5a92\u4f53\u8d44\u6e90\u3002<\/p>\n<p>\u5728\u4f20\u7edf\u79fb\u52a8\u5e73\u53f0\u4e2d&#xff0c;\u5f00\u53d1\u8005\u7ecf\u5e38\u901a\u8fc7\u6587\u4ef6\u8def\u5f84\u8bbf\u95ee\u56fe\u7247&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>\/storage\/emulated\/0\/DCIM\/Camera\/photo.jpg<\/p>\n<p>\u7136\u540e\u901a\u8fc7\u6587\u4ef6 API \u8bfb\u53d6\u56fe\u7247&#xff0c;\u518d\u8f6c\u6362\u4e3a Bitmap \u8fdb\u884c\u663e\u793a\u548c\u5904\u7406\u3002<\/p>\n<p>\u4f46\u662f HarmonyOS NEXT \u5e76\u6ca1\u6709\u91c7\u7528\u8fd9\u79cd\u76f4\u63a5\u8bbf\u95ee\u6587\u4ef6\u7cfb\u7edf\u7684\u65b9\u5f0f&#xff0c;\u800c\u662f\u63d0\u4f9b\u4e86\u4e00\u5957\u66f4\u52a0\u5b89\u5168\u3001\u7edf\u4e00\u7684\u5a92\u4f53\u8bbf\u95ee\u6846\u67b6\u3002<\/p>\n<p>\u6838\u5fc3\u5c31\u662f&#xff1a;<\/p>\n<p>PhotoAccessHelper<br \/>\n        |<br \/>\n        \u2193<br \/>\n    PhotoAsset<br \/>\n        |<br \/>\n        \u2193<br \/>\n    Asset URI<br \/>\n        |<br \/>\n        \u2193<br \/>\n  ImageSource<br \/>\n        |<br \/>\n        \u2193<br \/>\n    PixelMap<br \/>\n        |<br \/>\n        \u2193<br \/>\n \u56fe\u7247\u5904\u7406\u4e0e\u5c55\u793a<\/p>\n<p>\u8fd9\u5957\u4f53\u7cfb\u5c06&#xff1a;<\/p>\n<ul>\n<li>\u5a92\u4f53\u8d44\u6e90\u7ba1\u7406<\/li>\n<li>\u56fe\u7247\u89e3\u6790<\/li>\n<li>\u50cf\u7d20\u5904\u7406<\/li>\n<li>\u56fe\u7247\u7f16\u7801<\/li>\n<\/ul>\n<p>\u8fdb\u884c\u4e86\u6e05\u6670\u5206\u5c42\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u3001\u4e3a\u4ec0\u4e48 HarmonyOS \u4e0d\u63a8\u8350\u76f4\u63a5\u8bbf\u95ee\u56fe\u7247\u6587\u4ef6&#xff1f;<\/h2>\n<p>\u5f88\u591a\u719f\u6089 Android \u5f00\u53d1\u7684\u5de5\u7a0b\u5e08\u7b2c\u4e00\u6b21\u63a5\u89e6 HarmonyOS \u76f8\u518c API \u65f6&#xff0c;\u4f1a\u4e60\u60ef\u6027\u601d\u8003&#xff1a;<\/p>\n<p>\u201c\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u62ff\u56fe\u7247\u8def\u5f84&#xff1f;\u201d<\/p>\n<p>\u5b9e\u9645\u4e0a&#xff0c;\u8fd9\u662f\u73b0\u4ee3\u79fb\u52a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u53d1\u5c55\u8d8b\u52bf\u3002<\/p>\n<h3>1. \u6587\u4ef6\u8def\u5f84\u4e0d\u662f\u53ef\u9760\u7684\u6570\u636e\u6807\u8bc6<\/h3>\n<p>\u4f20\u7edf\u6a21\u5f0f&#xff1a;<\/p>\n<p>\/storage\/emulated\/0\/DCIM\/photo.jpg<\/p>\n<p>\u5b58\u5728\u5f88\u591a\u95ee\u9898\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u53ef\u80fd&#xff1a;<\/p>\n<ul>\n<li>\u79fb\u52a8\u56fe\u7247\u4f4d\u7f6e<\/li>\n<li>\u4fee\u6539\u6587\u4ef6\u540d\u79f0<\/li>\n<li>\u5220\u9664\u6587\u4ef6<\/li>\n<li>\u7cfb\u7edf\u8fdb\u884c\u5a92\u4f53\u6574\u7406<\/li>\n<\/ul>\n<p>\u8def\u5f84\u968f\u65f6\u53ef\u80fd\u53d8\u5316\u3002<\/p>\n<p>\u4f46\u662f\u7167\u7247\u8d44\u6e90\u672c\u8eab\u5e94\u8be5\u62e5\u6709\u4e00\u4e2a\u7a33\u5b9a\u8eab\u4efd\u3002<\/p>\n<p>\u56e0\u6b64 HarmonyOS \u4f7f\u7528 URI \u6807\u8bc6\u5a92\u4f53\u8d44\u6e90\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>photo:\/\/media\/xxxxx<\/p>\n<p>\u5e94\u7528\u5173\u6ce8\u7684\u662f&#xff1a;<\/p>\n<p>\u201c\u6211\u8981\u8bbf\u95ee\u54ea\u4e00\u5f20\u56fe\u7247\u201d<\/p>\n<p>\u800c\u4e0d\u662f&#xff1a;<\/p>\n<p>\u201c\u8fd9\u5f20\u56fe\u7247\u73b0\u5728\u5b58\u5728\u54ea\u4e2a\u8def\u5f84\u201d\u3002<\/p>\n<hr \/>\n<h3>2. \u4fdd\u62a4\u7528\u6237\u9690\u79c1<\/h3>\n<p>\u76f8\u518c\u5c5e\u4e8e\u7528\u6237\u9690\u79c1\u6570\u636e\u3002<\/p>\n<p>\u5982\u679c\u5e94\u7528\u53ef\u4ee5\u968f\u610f\u626b\u63cf&#xff1a;<\/p>\n<p>DCIM<\/p>\n<p>Pictures<\/p>\n<p>Download<\/p>\n<p>\u90a3\u4e48\u4efb\u4f55\u5e94\u7528\u90fd\u53ef\u80fd\u83b7\u53d6\u7528\u6237\u5168\u90e8\u7167\u7247\u3002<\/p>\n<p>\u56e0\u6b64 HarmonyOS \u5f15\u5165&#xff1a;<\/p>\n<ul>\n<li>\u6743\u9650\u63a7\u5236<\/li>\n<li>\u5a92\u4f53\u8d44\u6e90\u5bf9\u8c61<\/li>\n<li>\u7cfb\u7edf\u7ba1\u7406<\/li>\n<\/ul>\n<p>\u5e94\u7528\u53ea\u80fd\u8bbf\u95ee\u7528\u6237\u6388\u6743\u7684\u6570\u636e\u3002<\/p>\n<hr \/>\n<h3>3. \u7cfb\u7edf\u7edf\u4e00\u7ba1\u7406\u5a92\u4f53\u8d44\u6e90<\/h3>\n<p>HarmonyOS \u5c06\u56fe\u7247\u3001\u89c6\u9891\u7b49\u5a92\u4f53\u8d44\u6e90\u4ea4\u7ed9\u7cfb\u7edf\u5a92\u4f53\u5e93\u7ba1\u7406\u3002<\/p>\n<p>\u5e94\u7528\u4e0d\u76f4\u63a5\u7ba1\u7406\u6587\u4ef6\u3002<\/p>\n<p>\u6574\u4f53\u7ed3\u6784&#xff1a;<\/p>\n<p>              System Media Library<\/p>\n<p>                       |<\/p>\n<p>        &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>        |                              |<\/p>\n<p>      \u56fe\u7247                           \u89c6\u9891<\/p>\n<p>        |                              |<\/p>\n<p> PhotoAccessHelper             VideoAccessHelper<\/p>\n<p>\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1&#xff1a;<\/p>\n<ul>\n<li>\u6570\u636e\u4e00\u81f4\u6027<\/li>\n<li>\u6743\u9650\u5b89\u5168<\/li>\n<li>\u7cfb\u7edf\u4f18\u5316<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e09\u3001PhotoAccessHelper \u662f\u4ec0\u4e48&#xff1f;<\/h2>\n<p>PhotoAccessHelper \u662f HarmonyOS NEXT \u63d0\u4f9b\u7684\u5a92\u4f53\u8bbf\u95ee\u5165\u53e3\u3002<\/p>\n<p>\u5b83\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u67e5\u8be2\u7167\u7247<\/li>\n<li>\u67e5\u8be2\u89c6\u9891<\/li>\n<li>\u521b\u5efa\u5a92\u4f53\u8d44\u6e90<\/li>\n<li>\u5220\u9664\u5a92\u4f53\u8d44\u6e90<\/li>\n<li>\u83b7\u53d6\u5a92\u4f53\u4fe1\u606f<\/li>\n<\/ul>\n<p>\u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>PhotoAccessHelper \u662f\u5e94\u7528\u8bbf\u95ee\u7cfb\u7edf\u76f8\u518c\u7684\u7ba1\u7406\u5668\u3002<\/p>\n<p>\u5b83\u672c\u8eab\u5e76\u4e0d\u662f\u56fe\u7247\u3002<\/p>\n<p>\u5b83\u66f4\u50cf\u6570\u636e\u5e93\u8bbf\u95ee\u5c42\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>        \u2193<\/p>\n<p>\u67e5\u8be2\u5a92\u4f53\u8868<\/p>\n<p>        \u2193<\/p>\n<p>\u8fd4\u56de PhotoAsset<\/p>\n<hr \/>\n<h2>\u56db\u3001PhotoAsset \u662f\u4ec0\u4e48&#xff1f;<\/h2>\n<p>PhotoAsset \u662f\u76f8\u518c\u5f00\u53d1\u4e2d\u6700\u91cd\u8981\u7684\u6570\u636e\u5bf9\u8c61\u3002<\/p>\n<p>\u5b83\u4ee3\u8868&#xff1a;<\/p>\n<p>\u201c\u4e00\u5f20\u5a92\u4f53\u8d44\u6e90\u8bb0\u5f55\u201d\u3002<\/p>\n<p>\u4f8b\u5982\u7528\u6237\u624b\u673a\u4e2d\u6709&#xff1a;<\/p>\n<p>10000 \u5f20\u7167\u7247\u3002<\/p>\n<p>\u901a\u8fc7 PhotoAccessHelper \u67e5\u8be2\u540e&#xff0c;\u7cfb\u7edf\u8fd4\u56de\u7684\u662f\u4e00\u4e2a PhotoAsset \u96c6\u5408\u3002<\/p>\n<p>\u6bcf\u4e00\u4e2a PhotoAsset \u5bf9\u5e94\u4e00\u5f20\u7167\u7247\u3002<\/p>\n<p>\u5173\u7cfb\u5982\u4e0b&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p> PhotoAsset[]<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>10000 \u4e2a\u7167\u7247\u8d44\u6e90\u5bf9\u8c61<\/p>\n<hr \/>\n<p>\u4f46\u662f\u9700\u8981\u6ce8\u610f&#xff1a;<\/p>\n<p>PhotoAsset \u4e0d\u7b49\u4e8e\u56fe\u7247\u6570\u636e\u3002<\/p>\n<p>\u5b83\u91cc\u9762\u4fdd\u5b58\u7684\u662f\u56fe\u7247\u63cf\u8ff0\u4fe1\u606f&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>URI<\/li>\n<li>\u6587\u4ef6\u540d\u79f0<\/li>\n<li>\u521b\u5efa\u65f6\u95f4<\/li>\n<li>\u4fee\u6539\u65f6\u95f4<\/li>\n<li>\u6587\u4ef6\u5927\u5c0f<\/li>\n<li>\u56fe\u7247\u7c7b\u578b<\/li>\n<li>\u5bbd\u9ad8\u4fe1\u606f<\/li>\n<\/ul>\n<p>\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u6761\u8bb0\u5f55\u3002<\/p>\n<p>\u771f\u6b63\u7684\u56fe\u7247\u50cf\u7d20\u6570\u636e&#xff0c;\u9700\u8981\u7ee7\u7eed\u901a\u8fc7 ImageSource \u52a0\u8f7d\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u3001PhotoAccessHelper\u3001PhotoAsset\u3001PixelMap \u4e09\u8005\u5173\u7cfb<\/h2>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u5bb9\u6613\u6df7\u6dc6\u8fd9\u4e09\u4e2a\u5bf9\u8c61\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\u5b83\u4eec\u5904\u4e8e\u4e0d\u540c\u5c42\u7ea7\u3002<\/p>\n<h3>PhotoAccessHelper<\/h3>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u8bbf\u95ee\u5a92\u4f53\u5e93\u3002<\/p>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<p>\u201c\u53bb\u54ea\u627e\u56fe\u7247&#xff1f;\u201d<\/p>\n<hr \/>\n<h3>PhotoAsset<\/h3>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u8868\u793a\u4e00\u5f20\u56fe\u7247\u8d44\u6e90\u3002<\/p>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<p>\u201c\u6211\u8981\u54ea\u4e00\u5f20\u56fe\u7247&#xff1f;\u201d<\/p>\n<hr \/>\n<h3>PixelMap<\/h3>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u8868\u793a\u56fe\u7247\u50cf\u7d20\u3002<\/p>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<p>\u201c\u6211\u8981\u5982\u4f55\u4fee\u6539\u56fe\u7247&#xff1f;\u201d<\/p>\n<hr \/>\n<p>\u5b8c\u6574\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u76f8\u518c<\/p>\n<p>    \u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>    \u2193<\/p>\n<p>PhotoAsset<\/p>\n<p>    \u2193<\/p>\n<p>ImageSource<\/p>\n<p>    \u2193<\/p>\n<p>PixelMap<\/p>\n<p>    \u2193<\/p>\n<p>\u88c1\u526a \/ \u7f29\u653e \/ \u6ee4\u955c \/ \u538b\u7f29<\/p>\n<hr \/>\n<h2>\u516d\u3001\u521b\u5efa PhotoAccessHelper \u5b9e\u4f8b<\/h2>\n<p>\u5728 ArkTS \u4e2d&#xff0c;\u9700\u8981\u5148\u5bfc\u5165\u6a21\u5757&#xff1a;<\/p>\n<p>import photoAccessHelper from &#039;&#064;ohos.file.photoAccessHelper&#039;;<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>const context &#061; getContext(this);<\/p>\n<p>const helper &#061;<br \/>\n    photoAccessHelper.getPhotoAccessHelper(context);<\/p>\n<p>\u5f97\u5230\u7684 helper \u5bf9\u8c61\u5c31\u662f\u540e\u7eed\u8bbf\u95ee\u76f8\u518c\u7684\u6838\u5fc3\u5bf9\u8c61\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u3001HarmonyOS \u76f8\u518c\u6743\u9650\u4f53\u7cfb<\/h2>\n<p>\u8bbf\u95ee\u7528\u6237\u7167\u7247\u4e4b\u524d&#xff0c;\u9700\u8981\u7533\u8bf7\u6743\u9650\u3002<\/p>\n<p>\u4e3b\u8981\u6d89\u53ca&#xff1a;<\/p>\n<h3>\u8bfb\u53d6\u56fe\u7247\u548c\u89c6\u9891\u6743\u9650<\/h3>\n<p>ohos.permission.READ_IMAGEVIDEO<\/p>\n<p>\u7528\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u67e5\u8be2\u7167\u7247<\/li>\n<li>\u8bfb\u53d6\u56fe\u7247<\/li>\n<li>\u83b7\u53d6\u89c6\u9891\u8d44\u6e90<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5199\u5165\u56fe\u7247\u548c\u89c6\u9891\u6743\u9650<\/h3>\n<p>ohos.permission.WRITE_IMAGEVIDEO<\/p>\n<p>\u7528\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u4fdd\u5b58\u56fe\u7247<\/li>\n<li>\u521b\u5efa\u5a92\u4f53\u8d44\u6e90<\/li>\n<\/ul>\n<hr \/>\n<p>\u5728 module.json5 \u4e2d\u58f0\u660e&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;requestPermissions&#034;: [<br \/>\n    {<br \/>\n      &#034;name&#034;: &#034;ohos.permission.READ_IMAGEVIDEO&#034;<br \/>\n    },<br \/>\n    {<br \/>\n      &#034;name&#034;: &#034;ohos.permission.WRITE_IMAGEVIDEO&#034;<br \/>\n    }<br \/>\n  ]<br \/>\n}<\/p>\n<hr \/>\n<h2>\u516b\u3001\u52a8\u6001\u6743\u9650\u7533\u8bf7\u6d41\u7a0b<\/h2>\n<p>\u4ec5\u4ec5\u914d\u7f6e\u6743\u9650\u662f\u4e0d\u591f\u7684\u3002<\/p>\n<p>\u8fd0\u884c\u65f6\u4ecd\u7136\u9700\u8981\u7528\u6237\u6388\u6743\u3002<\/p>\n<p>\u5b8c\u6574\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u5e94\u7528\u542f\u52a8<\/p>\n<p>\u2193<\/p>\n<p>\u68c0\u67e5\u6743\u9650<\/p>\n<p>\u2193<\/p>\n<p>\u6ca1\u6709\u6743\u9650<\/p>\n<p>\u2193<\/p>\n<p>\u7533\u8bf7\u6743\u9650<\/p>\n<p>\u2193<\/p>\n<p>\u7528\u6237\u786e\u8ba4<\/p>\n<p>\u2193<\/p>\n<p>\u8bbf\u95ee\u76f8\u518c<\/p>\n<hr \/>\n<p>\u5b9e\u9645\u5f00\u53d1\u4e2d&#xff0c;\u4e0d\u5efa\u8bae App \u4e00\u542f\u52a8\u5c31\u5f39\u6743\u9650\u6846\u3002<\/p>\n<p>\u66f4\u597d\u7684\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u7528\u6237\u70b9\u51fb&#xff1a;<\/p>\n<p>\u201c\u9009\u62e9\u56fe\u7247\u201d<\/p>\n<p>\u6216\u8005&#xff1a;<\/p>\n<p>\u201c\u4e0a\u4f20\u5934\u50cf\u201d<\/p>\n<p>\u65f6&#xff0c;\u518d\u7533\u8bf7\u6743\u9650\u3002<\/p>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>\u7528\u6237\u6b64\u65f6\u660e\u786e\u77e5\u9053\u4e3a\u4ec0\u4e48\u9700\u8981\u6743\u9650\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u3001PhotoPicker \u4e0e PhotoAccessHelper \u533a\u522b<\/h2>\n<p>\u8fd9\u662f\u76f8\u518c\u5f00\u53d1\u4e2d\u7684\u91cd\u70b9\u3002<\/p>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u4f1a\u628a\u4e24\u8005\u6df7\u6dc6\u3002<\/p>\n<h3>PhotoPicker<\/h3>\n<p>\u5b83\u662f&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u56fe\u7247\u9009\u62e9\u5668\u3002<\/p>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u5e94\u7528<\/p>\n<p>\u2193<\/p>\n<p>\u6253\u5f00\u7cfb\u7edf\u9009\u62e9\u9875\u9762<\/p>\n<p>\u2193<\/p>\n<p>\u7528\u6237\u9009\u62e9\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>\u7279\u70b9&#xff1a;<\/p>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u5b89\u5168<\/li>\n<li>\u7b80\u5355<\/li>\n<li>\u4e0d\u9700\u8981\u81ea\u5df1\u5f00\u53d1\u56fe\u5e93<\/li>\n<\/ul>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u65e0\u6cd5\u7ba1\u7406\u6574\u4e2a\u76f8\u518c<\/li>\n<li>\u65e0\u6cd5\u505a\u590d\u6742\u56fe\u7247\u7ba1\u7406<\/li>\n<\/ul>\n<p>\u9002\u5408&#xff1a;<\/p>\n<p>\u4e0a\u4f20\u5934\u50cf\u3002<\/p>\n<hr \/>\n<h3>PhotoAccessHelper<\/h3>\n<p>\u5b83\u662f&#xff1a;<\/p>\n<p>\u5a92\u4f53\u5e93\u8bbf\u95ee API\u3002<\/p>\n<p>\u9002\u5408&#xff1a;<\/p>\n<p>\u5f00\u53d1\u5b8c\u6574\u76f8\u518c\u80fd\u529b\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>\u56fe\u7247\u6d4f\u89c8\u5668<\/li>\n<li>\u56fe\u7247\u7ba1\u7406\u5668<\/li>\n<li>\u4fee\u56fe\u8f6f\u4ef6<\/li>\n<li>\u4e91\u76f8\u518c<\/li>\n<\/ul>\n<hr \/>\n<h2>\u5341\u3001\u76f8\u518c\u5217\u8868\u5f00\u53d1\u6838\u5fc3\u8bbe\u8ba1<\/h2>\n<p>\u4e00\u4e2a\u771f\u5b9e\u76f8\u518c\u9875\u9762&#xff0c;\u4e0d\u5e94\u8be5\u8fd9\u6837&#xff1a;<\/p>\n<p>\u67e5\u8be2\u5168\u90e8\u7167\u7247<\/p>\n<p>\u2193<\/p>\n<p>\u5168\u90e8\u8f6c PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u663e\u793a<\/p>\n<p>\u8fd9\u662f\u9519\u8bef\u8bbe\u8ba1\u3002<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>\u7528\u6237\u53ef\u80fd\u6709&#xff1a;<\/p>\n<p>\u51e0\u4e07\u5f20\u7167\u7247\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e\u67b6\u6784&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>        \u2193<\/p>\n<p>\u67e5\u8be2 PhotoAsset<\/p>\n<p>        \u2193<\/p>\n<p>\u5206\u9875\u52a0\u8f7d<\/p>\n<p>        \u2193<\/p>\n<p>\u83b7\u53d6 Thumbnail<\/p>\n<p>        \u2193<\/p>\n<p>Grid\u663e\u793a<\/p>\n<hr \/>\n<p>\u76f8\u518c\u5217\u8868\u53ea\u9700\u8981&#xff1a;<\/p>\n<p>PhotoAsset &#043; \u7f29\u7565\u56fe\u3002<\/p>\n<p>\u4e0d\u8981\u52a0\u8f7d\u539f\u56fe\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u76f8\u518c\u5217\u8868\u4e0d\u80fd\u76f4\u63a5\u52a0\u8f7d PixelMap&#xff1f;<\/h2>\n<p>\u56e0\u4e3a PixelMap \u5f88\u5927\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4e00\u5f20\u7167\u7247&#xff1a;<\/p>\n<p>4000 \u00d7 3000\u3002<\/p>\n<p>RGBA \u5185\u5b58&#xff1a;<\/p>\n<p>\u7ea6&#xff1a;<\/p>\n<p>4000 \u00d7 3000 \u00d7 4<\/p>\n<p>\u224848MB<\/p>\n<p>\u5982\u679c\u540c\u65f6\u52a0\u8f7d&#xff1a;<\/p>\n<p>100 \u5f20&#xff1a;<\/p>\n<p>\u5c31\u662f&#xff1a;<\/p>\n<p>\u7ea6 4.8GB\u3002<\/p>\n<p>\u79fb\u52a8\u8bbe\u5907\u6839\u672c\u65e0\u6cd5\u627f\u53d7\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u76f8\u518c\u5217\u8868&#xff1a;<\/p>\n<p>\u4f7f\u7528 Thumbnail\u3002<\/p>\n<p>\u70b9\u51fb\u67e5\u770b&#xff1a;<\/p>\n<p>\u518d\u52a0\u8f7d PixelMap\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e8c\u3001\u7f29\u7565\u56fe\u52a0\u8f7d\u67b6\u6784<\/h2>\n<p>\u4f18\u79c0\u7684\u76f8\u518c\u5217\u8868\u91c7\u7528&#xff1a;<\/p>\n<p>\u53ef\u89c1\u533a\u57df\u52a0\u8f7d\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u5f53\u524d\u5c4f\u5e55\u663e\u793a&#xff1a;<\/p>\n<p>30 \u5f20\u56fe\u7247\u3002<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>\u53ea\u9700\u8981\u63d0\u524d\u52a0\u8f7d&#xff1a;<\/p>\n<p>30&#xff5e;50 \u5f20\u7f29\u7565\u56fe\u3002<\/p>\n<p>\u800c\u4e0d\u662f\u52a0\u8f7d\u6574\u4e2a\u76f8\u518c\u3002<\/p>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7528\u6237\u6253\u5f00\u9875\u9762<\/p>\n<p>        \u2193<\/p>\n<p>\u67e5\u8be2 PhotoAsset<\/p>\n<p>        \u2193<\/p>\n<p>\u8ba1\u7b97\u53ef\u89c1\u533a\u57df<\/p>\n<p>        \u2193<\/p>\n<p>\u52a0\u8f7d Thumbnail<\/p>\n<p>        \u2193<\/p>\n<p>\u7f13\u5b58<\/p>\n<p>        \u2193<\/p>\n<p>\u663e\u793a<\/p>\n<h3>\u5341\u56db\u3001PhotoAccessHelper \u67e5\u8be2\u673a\u5236\u6df1\u5165\u89e3\u6790<\/h3>\n<p>\u524d\u9762\u6211\u4eec\u4e86\u89e3\u4e86 PhotoAccessHelper \u7684\u57fa\u672c\u5b9a\u4f4d\u3002<\/p>\n<p>\u5b9e\u9645\u9879\u76ee\u4e2d&#xff0c;\u771f\u6b63\u590d\u6742\u7684\u90e8\u5206\u5e76\u4e0d\u662f\u521b\u5efa PhotoAccessHelper&#xff0c;\u800c\u662f\u5982\u4f55\u9ad8\u6548\u67e5\u8be2\u5a92\u4f53\u8d44\u6e90\u3002<\/p>\n<p>\u4e00\u4e2a\u7b80\u5355 Demo \u53ef\u80fd\u53ea\u6709\u51e0\u5341\u5f20\u56fe\u7247&#xff0c;\u4f46\u662f\u4f01\u4e1a\u7ea7\u5e94\u7528\u9762\u5bf9\u7684\u662f&#xff1a;<\/p>\n<ul>\n<li>\u7528\u6237\u51e0\u5343\u5f20\u7167\u7247<\/li>\n<li>\u7528\u6237\u51e0\u4e07\u5f20\u7167\u7247<\/li>\n<li>\u591a\u76f8\u518c\u5206\u7c7b<\/li>\n<li>\u65f6\u95f4\u6392\u5e8f<\/li>\n<li>\u7c7b\u578b\u7b5b\u9009<\/li>\n<li>\u5206\u9875\u52a0\u8f7d<\/li>\n<li>\u5feb\u901f\u6eda\u52a8<\/li>\n<\/ul>\n<p>\u56e0\u6b64&#xff0c;\u76f8\u518c\u67e5\u8be2\u7cfb\u7edf\u5fc5\u987b\u5177\u5907\u9ad8\u6027\u80fd\u3002<\/p>\n<hr \/>\n<h3>1. \u76f8\u518c\u67e5\u8be2\u672c\u8d28\u662f\u4ec0\u4e48&#xff1f;<\/h3>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u8ba4\u4e3a&#xff1a;<\/p>\n<p>\u67e5\u8be2\u76f8\u518c\u5c31\u662f&#xff1a;<\/p>\n<p>\u201c\u8bfb\u53d6\u56fe\u7247\u5217\u8868\u201d\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\u5e76\u4e0d\u662f\u3002<\/p>\n<p>HarmonyOS \u7684\u76f8\u518c\u4f53\u7cfb\u672c\u8d28\u4e0a\u662f&#xff1a;<\/p>\n<p>\u5e94\u7528\u901a\u8fc7 PhotoAccessHelper \u67e5\u8be2\u7cfb\u7edf\u5a92\u4f53\u6570\u636e\u5e93\u3002<\/p>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u5e94\u7528<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u2193<\/p>\n<p>Media Library<\/p>\n<p>\u2193<\/p>\n<p>\u5a92\u4f53\u6570\u636e\u5e93<\/p>\n<p>\u2193<\/p>\n<p>PhotoAsset\u96c6\u5408<\/p>\n<p>\u2193<\/p>\n<p>\u5e94\u7528\u5c55\u793a<\/p>\n<hr \/>\n<p>\u7cfb\u7edf\u5185\u90e8\u7ef4\u62a4\u7684\u662f\u5a92\u4f53\u7d22\u5f15\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4e00\u5f20\u7167\u7247\u53ef\u80fd\u5305\u542b&#xff1a;<\/p>\n<table>\n<tr>\u5c5e\u6027\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>URI<\/td>\n<td>photo:\/\/media\/xxx<\/td>\n<\/tr>\n<tr>\n<td>\u540d\u79f0<\/td>\n<td>IMG_001.jpg<\/td>\n<\/tr>\n<tr>\n<td>\u7c7b\u578b<\/td>\n<td>IMAGE<\/td>\n<\/tr>\n<tr>\n<td>\u5927\u5c0f<\/td>\n<td>4MB<\/td>\n<\/tr>\n<tr>\n<td>\u5bbd\u5ea6<\/td>\n<td>4000<\/td>\n<\/tr>\n<tr>\n<td>\u9ad8\u5ea6<\/td>\n<td>3000<\/td>\n<\/tr>\n<tr>\n<td>\u521b\u5efa\u65f6\u95f4<\/td>\n<td>2026-08-02<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5e94\u7528\u67e5\u8be2\u65f6&#xff0c;\u5e76\u4e0d\u662f\u626b\u63cf\u78c1\u76d8\u6587\u4ef6\u3002<\/p>\n<p>\u800c\u662f\u5728\u67e5\u8be2\u7cfb\u7edf\u5df2\u7ecf\u5efa\u7acb\u597d\u7684\u5a92\u4f53\u7d22\u5f15\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e94\u3001\u4e3a\u4ec0\u4e48\u5a92\u4f53\u6570\u636e\u5e93\u6bd4\u6587\u4ef6\u626b\u63cf\u5feb&#xff1f;<\/h2>\n<p>\u5047\u8bbe\u624b\u673a\u4e2d\u6709&#xff1a;<\/p>\n<p>20000 \u5f20\u7167\u7247\u3002<\/p>\n<p>\u4f20\u7edf\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u626b\u63cf\u76ee\u5f55<\/p>\n<p>\u2193<\/p>\n<p>\u8bfb\u53d6\u6587\u4ef6\u4fe1\u606f<\/p>\n<p>\u2193<\/p>\n<p>\u5224\u65ad\u662f\u5426\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>\u6392\u5e8f<\/p>\n<p>\u2193<\/p>\n<p>\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>\u8fd9\u4e2a\u8fc7\u7a0b\u975e\u5e38\u6162\u3002<\/p>\n<hr \/>\n<p>\u5a92\u4f53\u6570\u636e\u5e93\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u67e5\u8be2\u7d22\u5f15<\/p>\n<p>\u2193<\/p>\n<p>\u8fd4\u56de\u8bb0\u5f55<\/p>\n<p>\u7c7b\u4f3c\u6570\u636e\u5e93&#xff1a;<\/p>\n<p>SELECT *<br \/>\nFROM photo<br \/>\nORDER BY createTime DESC<br \/>\nLIMIT 50;<\/p>\n<p>\u901f\u5ea6\u4f1a\u5feb\u5f88\u591a\u3002<\/p>\n<hr \/>\n<h2>\u5341\u516d\u3001\u76f8\u518c\u67e5\u8be2\u4e0d\u8981\u4e00\u6b21\u52a0\u8f7d\u5168\u90e8\u6570\u636e<\/h2>\n<p>\u8fd9\u662f\u4f01\u4e1a\u5f00\u53d1\u4e2d\u6700\u91cd\u8981\u7684\u539f\u5219\u3002<\/p>\n<p>\u9519\u8bef&#xff1a;<\/p>\n<p>\u6253\u5f00\u76f8\u518c<\/p>\n<p>\u2193<\/p>\n<p>\u67e5\u8be2\u5168\u90e810000\u5f20\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>\u4fdd\u5b58\u6570\u7ec4<\/p>\n<p>\u2193<\/p>\n<p>\u663e\u793a<\/p>\n<p>\u95ee\u9898&#xff1a;<\/p>\n<li>\u9996\u5c4f\u6162<\/li>\n<li>\u5185\u5b58\u5360\u7528\u589e\u52a0<\/li>\n<li>\u6570\u636e\u5904\u7406\u65f6\u95f4\u957f<\/li>\n<li>\u7528\u6237\u4f53\u9a8c\u5dee<\/li>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u5206\u9875\u67e5\u8be2\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b21&#xff1a;<\/p>\n<p>\u52a0\u8f7d50\u5f20<\/p>\n<p>\u7528\u6237\u6ed1\u52a8&#xff1a;<\/p>\n<p>\u7ee7\u7eed\u52a0\u8f7d50\u5f20<\/p>\n<p>\u5f62\u6210&#xff1a;<\/p>\n<p>\u65e0\u9650\u6eda\u52a8\u3002<\/p>\n<hr \/>\n<p>\u7ed3\u6784&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u9875<\/p>\n<p>PhotoAsset[0-49]<\/p>\n<p>\u7b2c\u4e8c\u9875<\/p>\n<p>PhotoAsset[50-99]<\/p>\n<p>\u7b2c\u4e09\u9875<\/p>\n<p>PhotoAsset[100-149]<\/p>\n<hr \/>\n<h2>\u5341\u4e03\u3001\u76f8\u518c\u5206\u9875\u67b6\u6784\u8bbe\u8ba1<\/h2>\n<p>\u63a8\u8350&#xff1a;<\/p>\n<p>Repository \u5c42\u8d1f\u8d23\u5206\u9875\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>GalleryPage<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>GalleryViewModel<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>PhotoRepository<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<hr \/>\n<p>ViewModel \u4e0d\u5e94\u8be5\u76f4\u63a5\u8c03\u7528&#xff1a;<\/p>\n<p>PhotoAccessHelper\u3002<\/p>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>\u9875\u9762\u4e0d\u5e94\u8be5\u77e5\u9053\u5e95\u5c42\u5a92\u4f53\u8bbf\u95ee\u903b\u8f91\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u9519\u8bef&#xff1a;<\/p>\n<p>&#064;Component<br \/>\nstruct Gallery {<\/p>\n<p>    helper.getAssets()<\/p>\n<p>}<\/p>\n<p>\u9875\u9762\u76f4\u63a5\u4f9d\u8d56\u7cfb\u7edf API\u3002<\/p>\n<p>\u540e\u671f&#xff1a;<\/p>\n<p>\u5f88\u96be\u7ef4\u62a4\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>UI<\/p>\n<p>\u2193<\/p>\n<p>ViewModel<\/p>\n<p>\u2193<\/p>\n<p>Repository<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<hr \/>\n<h2>\u5341\u516b\u3001PhotoAsset \u5206\u9875\u6570\u636e\u7ba1\u7406<\/h2>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u9875\u8fd4\u56de&#xff1a;<\/p>\n<p>50\u4e2a PhotoAsset\u3002<\/p>\n<p>\u4fdd\u5b58&#xff1a;<\/p>\n<p>let assets: PhotoAsset[] &#061; [];<\/p>\n<p>\u8ffd\u52a0&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b21&#xff1a;<\/p>\n<p>assets:<\/p>\n<p>[<br \/>\n photo1,<br \/>\n photo2,<br \/>\n &#8230;<br \/>\n photo50<br \/>\n]<\/p>\n<p>\u7b2c\u4e8c\u6b21&#xff1a;<\/p>\n<p>\u8ffd\u52a0:<\/p>\n<p>photo51-photo100<\/p>\n<hr \/>\n<p>\u4f46\u662f\u9700\u8981\u6ce8\u610f&#xff1a;<\/p>\n<p>\u4e0d\u8981\u65e0\u9650\u4fdd\u5b58\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u6d4f\u89c8&#xff1a;<\/p>\n<p>10000\u5f20\u56fe\u7247\u3002<\/p>\n<p>\u5168\u90e8\u4fdd\u5b58\u5728\u5185\u5b58&#xff1a;<\/p>\n<p>\u6ca1\u6709\u5fc5\u8981\u3002<\/p>\n<hr \/>\n<p>\u53ef\u4ee5\u91c7\u7528&#xff1a;<\/p>\n<p>\u7a97\u53e3\u7f13\u5b58\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u53ea\u4fdd\u5b58&#xff1a;<\/p>\n<p>\u6700\u8fd1\u6d4f\u89c8\u7684&#xff1a;<\/p>\n<p>200&#xff5e;500\u4e2a\u5bf9\u8c61\u3002<\/p>\n<hr \/>\n<h2>\u5341\u4e5d\u3001DataSharePredicates \u6761\u4ef6\u67e5\u8be2<\/h2>\n<p>HarmonyOS \u67e5\u8be2\u5a92\u4f53\u8d44\u6e90\u65f6&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u6761\u4ef6\u8fc7\u6ee4\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u53ea\u67e5\u8be2\u56fe\u7247\u3002<\/p>\n<p>\u53ea\u67e5\u8be2\u6700\u8fd1\u7167\u7247\u3002<\/p>\n<p>\u53ea\u67e5\u8be2\u67d0\u4e2a\u65f6\u95f4\u8303\u56f4\u3002<\/p>\n<hr \/>\n<p>\u4e3a\u4ec0\u4e48\u9700\u8981\u6761\u4ef6\u67e5\u8be2&#xff1f;<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>\u5a92\u4f53\u5e93\u6570\u636e\u53ef\u80fd\u975e\u5e38\u5927\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237&#xff1a;<\/p>\n<p>\u6709&#xff1a;<\/p>\n<p>50000\u5f20\u7167\u7247\u3002<\/p>\n<p>\u4f46\u662f\u9875\u9762&#xff1a;<\/p>\n<p>\u53ea\u9700\u8981&#xff1a;<\/p>\n<p>\u6700\u8fd1100\u5f20\u3002<\/p>\n<hr \/>\n<p>\u5e94\u8be5&#xff1a;<\/p>\n<p>\u8ba9\u7cfb\u7edf\u8fc7\u6ee4\u3002<\/p>\n<p>\u800c\u4e0d\u662f&#xff1a;<\/p>\n<p>\u5e94\u7528\u62ff\u5168\u90e8\u6570\u636e\u540e\u8fc7\u6ee4\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u9519\u8bef&#xff1a;<\/p>\n<p>50000\u5f20\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>\u5e94\u7528\u8fc7\u6ee4<\/p>\n<p>\u2193<\/p>\n<p>\u5269\u4f59100\u5f20<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u67e5\u8be2\u6761\u4ef6<\/p>\n<p>\u2193<\/p>\n<p>\u7cfb\u7edf\u8fc7\u6ee4<\/p>\n<p>\u2193<\/p>\n<p>\u8fd4\u56de100\u5f20<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u3001\u6309\u7167\u65f6\u95f4\u6392\u5e8f\u76f8\u518c<\/h2>\n<p>\u7528\u6237\u76f8\u518c\u901a\u5e38\u6309\u7167&#xff1a;<\/p>\n<p>\u521b\u5efa\u65f6\u95f4\u5012\u5e8f\u3002<\/p>\n<p>\u4e5f\u5c31\u662f&#xff1a;<\/p>\n<p>\u6700\u65b0\u7167\u7247\u663e\u793a\u5728\u6700\u524d\u9762\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>2026-08-02 20:30<\/p>\n<p>2026-08-01 18:20<\/p>\n<p>2026-07-30 12:10<\/p>\n<hr \/>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>\u7b26\u5408\u7528\u6237\u4e60\u60ef\u3002<\/p>\n<p>\u6253\u5f00\u76f8\u518c&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u773c\u770b\u5230&#xff1a;<\/p>\n<p>\u6700\u8fd1\u62cd\u6444\u5185\u5bb9\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e00\u3001Album \u76f8\u518c\u5206\u7c7b\u7ba1\u7406<\/h2>\n<p>\u9664\u4e86\u5168\u90e8\u7167\u7247&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u8fd8\u5b58\u5728&#xff1a;<\/p>\n<p>\u76f8\u518c\u5206\u7c7b\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>Camera<\/li>\n<li>Screenshots<\/li>\n<li>Downloads<\/li>\n<li>\u5fae\u4fe1\u56fe\u7247<\/li>\n<li>\u81ea\u5b9a\u4e49\u76f8\u518c<\/li>\n<\/ul>\n<hr \/>\n<p>\u5728 HarmonyOS \u4e2d&#xff1a;<\/p>\n<p>Album \u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>\u7167\u7247\u96c6\u5408\u3002<\/p>\n<p>\u7ed3\u6784&#xff1a;<\/p>\n<p>Album<\/p>\n<p>    |<\/p>\n<p>    |<\/p>\n<p>PhotoAsset[]<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Camera \u76f8\u518c&#xff1a;<\/p>\n<p>Camera Album<\/p>\n<p>    |<\/p>\n<p>    \u251c\u2500\u2500 photo1<\/p>\n<p>    \u251c\u2500\u2500 photo2<\/p>\n<p>    \u2514\u2500\u2500 photo3<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e8c\u3001\u4e3a\u4ec0\u4e48\u9700\u8981 Album&#xff1f;<\/h2>\n<p>\u5982\u679c\u5e94\u7528\u53ea\u5c55\u793a\u5168\u90e8\u7167\u7247&#xff1a;<\/p>\n<p>\u7528\u6237\u4f53\u9a8c\u4e0d\u597d\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u6709&#xff1a;<\/p>\n<p>10000\u5f20\u56fe\u7247\u3002<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>\u622a\u56fe&#xff1a;<\/p>\n<p>3000\u5f20\u3002<\/p>\n<p>\u804a\u5929\u56fe\u7247&#xff1a;<\/p>\n<p>4000\u5f20\u3002<\/p>\n<p>\u76f8\u673a\u7167\u7247&#xff1a;<\/p>\n<p>3000\u5f20\u3002<\/p>\n<hr \/>\n<p>\u7528\u6237\u901a\u5e38\u5e0c\u671b&#xff1a;<\/p>\n<p>\u5feb\u901f\u8fdb\u5165&#xff1a;<\/p>\n<p>\u201c\u76f8\u673a\u7167\u7247\u201d\u3002<\/p>\n<hr \/>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<p>Album \u662f\u76f8\u518c\u5e94\u7528\u7684\u91cd\u8981\u80fd\u529b\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e09\u3001\u81ea\u5b9a\u4e49\u76f8\u518c\u8bbe\u8ba1<\/h2>\n<p>\u5f88\u591a\u56fe\u7247\u5e94\u7528\u90fd\u6709&#xff1a;<\/p>\n<p>\u521b\u5efa\u6587\u4ef6\u5939\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u201c\u65c5\u884c\u7167\u7247\u201d<\/p>\n<p>\u201c\u5de5\u4f5c\u8d44\u6599\u201d<\/p>\n<p>\u201c\u8bbe\u8ba1\u7d20\u6750\u201d<\/p>\n<hr \/>\n<p>\u903b\u8f91&#xff1a;<\/p>\n<p>\u4e0d\u662f\u590d\u5236\u56fe\u7247\u3002<\/p>\n<p>\u800c\u662f&#xff1a;<\/p>\n<p>\u521b\u5efa\u5a92\u4f53\u96c6\u5408\u5173\u7cfb\u3002<\/p>\n<hr \/>\n<p>\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93&#xff1a;<\/p>\n<p>Album<\/p>\n<p>    |<\/p>\n<p>    |<\/p>\n<p>PhotoAsset<\/p>\n<hr \/>\n<p>\u4e00\u5f20\u56fe\u7247&#xff1a;<\/p>\n<p>\u53ef\u4ee5\u5c5e\u4e8e&#xff1a;<\/p>\n<p>\u4e0d\u540c\u903b\u8f91\u5206\u7c7b\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u56db\u3001\u76f8\u518c\u5217\u8868\u6027\u80fd\u4f18\u5316\u6838\u5fc3<\/h2>\n<p>\u4e00\u4e2a\u4f18\u79c0\u7684\u76f8\u518c\u9875\u9762&#xff0c;\u9700\u8981\u89e3\u51b3\u4e09\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<h3>\u7b2c\u4e00&#xff1a;\u67e5\u8be2\u901f\u5ea6<\/h3>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<p>\u5206\u9875\u67e5\u8be2\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c&#xff1a;\u663e\u793a\u901f\u5ea6<\/h3>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<p>Thumbnail\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09&#xff1a;\u5185\u5b58\u63a7\u5236<\/h3>\n<p>\u89e3\u51b3&#xff1a;<\/p>\n<p>\u7f13\u5b58\u7b56\u7565\u3002<\/p>\n<hr \/>\n<p>\u6574\u4f53&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u2193<\/p>\n<p>\u5206\u9875PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>Thumbnail\u52a0\u8f7d<\/p>\n<p>\u2193<\/p>\n<p>LRU\u7f13\u5b58<\/p>\n<p>\u2193<\/p>\n<p>Grid\u663e\u793a<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e94\u3001Thumbnail \u4e3a\u4ec0\u4e48\u662f\u76f8\u518c\u6027\u80fd\u5173\u952e&#xff1f;<\/h2>\n<p>\u56fe\u7247\u52a0\u8f7d\u4e3b\u8981\u6709\u4e24\u4e2a\u9636\u6bb5&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u9636\u6bb5&#xff1a;<\/p>\n<p>\u89e3\u7801\u3002<\/p>\n<p>\u7b2c\u4e8c\u9636\u6bb5&#xff1a;<\/p>\n<p>\u6e32\u67d3\u3002<\/p>\n<hr \/>\n<p>\u539f\u56fe&#xff1a;<\/p>\n<p>4000\u00d73000\u3002<\/p>\n<p>\u89e3\u7801\u6210\u672c\u975e\u5e38\u9ad8\u3002<\/p>\n<hr \/>\n<p>\u7f29\u7565\u56fe&#xff1a;<\/p>\n<p>200\u00d7200\u3002<\/p>\n<p>\u6210\u672c\u4f4e\u5f88\u591a\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u5217\u8868\u6c38\u8fdc&#xff1a;<\/p>\n<p>\u4f18\u5148\u7f29\u7565\u56fe\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u516d\u3001Thumbnail \u7f13\u5b58\u8bbe\u8ba1<\/h2>\n<p>\u5982\u679c\u6ca1\u6709\u7f13\u5b58&#xff1a;<\/p>\n<p>\u7528\u6237\u6ed1\u52a8&#xff1a;<\/p>\n<p>\u8fc7\u7a0b&#xff1a;<\/p>\n<p>\u5411\u4e0b\u6ed1<\/p>\n<p>\u52a0\u8f7d\u56fe\u7247<\/p>\n<p>\u5411\u4e0a\u6ed1<\/p>\n<p>\u91cd\u65b0\u52a0\u8f7d<\/p>\n<hr \/>\n<p>\u5927\u91cf\u91cd\u590d\u5de5\u4f5c\u3002<\/p>\n<hr \/>\n<p>\u52a0\u5165\u7f13\u5b58&#xff1a;<\/p>\n<p>URI<\/p>\n<p>\u2193<\/p>\n<p>Thumbnail<\/p>\n<hr \/>\n<p>\u518d\u6b21\u663e\u793a&#xff1a;<\/p>\n<p>\u76f4\u63a5&#xff1a;<\/p>\n<p>\u4ece\u7f13\u5b58\u83b7\u53d6\u3002<\/p>\n<hr \/>\n<p>\u5e38\u89c1\u7b56\u7565&#xff1a;<\/p>\n<p>LRU\u3002<\/p>\n<p>Least Recently Used\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7f13\u5b58&#xff1a;<\/p>\n<p>200\u5f20\u7f29\u7565\u56fe\u3002<\/p>\n<p>\u8d85\u8fc7&#xff1a;<\/p>\n<p>\u5220\u9664\u6700\u4e45\u672a\u4f7f\u7528\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u4e03\u3001\u76f8\u518c\u6eda\u52a8\u4f18\u5316<\/h2>\n<p>\u5927\u578b\u76f8\u518c&#xff1a;<\/p>\n<p>\u6700\u5bb9\u6613\u51fa\u73b0&#xff1a;<\/p>\n<p>\u95ee\u9898&#xff1a;<\/p>\n<p>\u5feb\u901f\u6ed1\u52a8\u5361\u987f\u3002<\/p>\n<hr \/>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>\u6ed1\u52a8\u8fc7\u7a0b\u4e2d&#xff1a;<\/p>\n<p>\u4e0d\u65ad&#xff1a;<\/p>\n<p>\u521b\u5efa\u56fe\u7247\u5bf9\u8c61\u3002<\/p>\n<hr \/>\n<p>\u4f18\u5316&#xff1a;<\/p>\n<h3>1. \u590d\u7528\u7ec4\u4ef6<\/h3>\n<p>\u907f\u514d\u91cd\u590d\u521b\u5efa\u3002<\/p>\n<hr \/>\n<h3>2. \u63a7\u5236\u5e76\u53d1\u52a0\u8f7d\u6570\u91cf<\/h3>\n<p>\u4e0d\u8981&#xff1a;<\/p>\n<p>\u540c\u65f6\u52a0\u8f7d100\u5f20\u3002<\/p>\n<hr \/>\n<h3>3. \u4f18\u5148\u52a0\u8f7d\u53ef\u89c1\u533a\u57df<\/h3>\n<p>\u5f53\u524d\u5c4f\u5e55\u4f18\u5148\u7ea7\u6700\u9ad8\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u6b63\u5728\u770b&#xff1a;<\/p>\n<p>\u7b2c500\u5f20\u3002<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>500\u9644\u8fd1\u56fe\u7247\u4f18\u5148\u3002<\/p>\n<hr \/>\n<h2>\u4e8c\u5341\u516b\u3001\u4f01\u4e1a\u7ea7\u76f8\u518c\u6570\u636e\u6d41<\/h2>\n<p>\u5b8c\u6574\u67b6\u6784&#xff1a;<\/p>\n<p>\u7528\u6237\u6253\u5f00\u76f8\u518c<\/p>\n<p>        \u2193<\/p>\n<p>GalleryPage<\/p>\n<p>        \u2193<\/p>\n<p>ViewModel<\/p>\n<p>        \u2193<\/p>\n<p>PhotoRepository<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAsset\u5206\u9875\u6570\u636e<\/p>\n<p>        \u2193<\/p>\n<p>Thumbnail Manager<\/p>\n<p>        \u2193<\/p>\n<p>Image\u7ec4\u4ef6\u663e\u793a<\/p>\n<hr \/>\n<p>\u8fd9\u4e2a\u67b6\u6784\u53ef\u4ee5\u652f\u6301&#xff1a;<\/p>\n<ul>\n<li>\u4e07\u7ea7\u56fe\u7247<\/li>\n<li>\u5feb\u901f\u6eda\u52a8<\/li>\n<li>\u56fe\u7247\u7f13\u5b58<\/li>\n<li>\u540e\u53f0\u52a0\u8f7d<\/li>\n<\/ul>\n<h3>\u4e09\u5341\u3001PhotoAsset \u83b7\u53d6\u56fe\u7247\u6570\u636e\u5b8c\u6574\u6d41\u7a0b<\/h3>\n<p>\u524d\u9762\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3&#xff1a;<\/p>\n<ul>\n<li>PhotoAccessHelper \u8d1f\u8d23\u8bbf\u95ee\u7cfb\u7edf\u5a92\u4f53\u5e93<\/li>\n<li>PhotoAsset \u4ee3\u8868\u5a92\u4f53\u8d44\u6e90<\/li>\n<li>Thumbnail \u7528\u4e8e\u76f8\u518c\u5217\u8868\u5c55\u793a<\/li>\n<\/ul>\n<p>\u4f46\u662f\u5f53\u7528\u6237\u70b9\u51fb\u4e00\u5f20\u56fe\u7247&#xff0c;\u9700\u8981\u8fdb\u5165&#xff1a;<\/p>\n<ul>\n<li>\u56fe\u7247\u9884\u89c8<\/li>\n<li>\u56fe\u7247\u7f16\u8f91<\/li>\n<li>\u56fe\u7247\u538b\u7f29<\/li>\n<li>\u56fe\u7247\u4e0a\u4f20<\/li>\n<\/ul>\n<p>\u573a\u666f\u65f6&#xff0c;\u5c31\u4e0d\u80fd\u7ee7\u7eed\u4f7f\u7528\u7f29\u7565\u56fe\u3002<\/p>\n<p>\u8fd9\u65f6\u5019\u9700\u8981\u83b7\u53d6\u771f\u6b63\u7684\u56fe\u7247\u6570\u636e\u3002<\/p>\n<p>\u5b8c\u6574\u6d41\u7a0b&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>\u6253\u5f00\u5a92\u4f53\u8d44\u6e90<\/p>\n<p>\u2193<\/p>\n<p>\u83b7\u53d6\u6587\u4ef6\u63cf\u8ff0\u7b26<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u56fe\u7247\u5904\u7406<\/p>\n<hr \/>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5&#xff1a;<\/p>\n<p>PhotoAsset \u672c\u8eab\u4e0d\u662f\u56fe\u7247\u3002<\/p>\n<p>\u5b83\u53ea\u662f\u56fe\u7247\u8d44\u6e90\u7684\u4e00\u4e2a\u5f15\u7528\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>{<br \/>\n    uri: &#034;photo:\/\/media\/xxx&#034;,<br \/>\n    name: &#034;IMG_001.jpg&#034;,<br \/>\n    size: 5242880<br \/>\n}<\/p>\n<p>\u5b83\u544a\u8bc9\u7cfb\u7edf&#xff1a;<\/p>\n<p>\u201c\u6211\u8981\u8bbf\u95ee\u54ea\u5f20\u56fe\u7247\u201d\u3002<\/p>\n<p>\u4f46\u662f&#xff1a;<\/p>\n<p>\u771f\u6b63\u7684 JPEG \u4e8c\u8fdb\u5236\u6570\u636e&#xff0c;\u9700\u8981\u901a\u8fc7\u5a92\u4f53\u63a5\u53e3\u8bfb\u53d6\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e00\u3001PhotoAsset \u83b7\u53d6\u8d44\u6e90\u53e5\u67c4<\/h2>\n<p>\u5728 HarmonyOS \u4e2d&#xff0c;\u8bbf\u95ee\u5a92\u4f53\u8d44\u6e90\u901a\u5e38\u9700\u8981\u901a\u8fc7 PhotoAsset \u63d0\u4f9b\u7684\u65b9\u6cd5\u83b7\u53d6\u8d44\u6e90\u8bbf\u95ee\u80fd\u529b\u3002<\/p>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>open()<\/p>\n<p>\u2193<\/p>\n<p>\u6587\u4ef6\u63cf\u8ff0\u7b26<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<hr \/>\n<p>\u4e3a\u4ec0\u4e48\u4e0d\u662f\u76f4\u63a5\u4f20 URI \u7ed9 ImageSource&#xff1f;<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>URI \u662f\u8d44\u6e90\u6807\u8bc6\u3002<\/p>\n<p>\u800c ImageSource \u9700\u8981&#xff1a;<\/p>\n<p>\u53ef\u8bfb\u53d6\u7684\u6570\u636e\u6e90\u3002<\/p>\n<p>\u4e24\u8005\u804c\u8d23\u4e0d\u540c\u3002<\/p>\n<hr \/>\n<p>\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93&#xff1a;<\/p>\n<p>\u7528\u6237ID<\/p>\n<p>\u2193<\/p>\n<p>\u67e5\u8be2\u7528\u6237<\/p>\n<p>\u2193<\/p>\n<p>\u83b7\u53d6\u7528\u6237\u6570\u636e<\/p>\n<p>\u4e0d\u80fd&#xff1a;<\/p>\n<p>\u76f4\u63a5\u62ff ID \u5f53\u7528\u6237\u5bf9\u8c61\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e8c\u3001ImageSource \u5728\u76f8\u518c\u4e2d\u7684\u4f5c\u7528<\/h2>\n<p>ImageSource \u662f\u56fe\u7247\u89e3\u6790\u5165\u53e3\u3002<\/p>\n<p>\u5b83\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u8bfb\u53d6\u56fe\u7247\u7f16\u7801\u6570\u636e<\/li>\n<li>\u89e3\u6790 JPEG<\/li>\n<li>\u89e3\u6790 PNG<\/li>\n<li>\u83b7\u53d6\u56fe\u7247\u4fe1\u606f<\/li>\n<li>\u521b\u5efa PixelMap<\/li>\n<\/ul>\n<hr \/>\n<p>\u5b8c\u6574\u5173\u7cfb&#xff1a;<\/p>\n<p>JPEG\u6587\u4ef6<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4e00\u5f20\u7167\u7247&#xff1a;<\/p>\n<p>IMG_001.jpg<\/p>\n<p>\u5185\u90e8&#xff1a;<\/p>\n<p>\u5176\u5b9e\u662f&#xff1a;<\/p>\n<p>\u538b\u7f29\u540e\u7684 JPEG \u6570\u636e\u3002<\/p>\n<p>\u7a0b\u5e8f\u4e0d\u80fd\u76f4\u63a5\u4fee\u6539 JPEG \u6587\u4ef6\u4e2d\u7684\u50cf\u7d20\u3002<\/p>\n<p>\u5fc5\u987b&#xff1a;<\/p>\n<p>\u5148\u89e3\u7801\u3002<\/p>\n<hr \/>\n<p>\u89e3\u7801\u8fc7\u7a0b&#xff1a;<\/p>\n<p>JPEG\u538b\u7f29\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>JPEG Decoder<\/p>\n<p>\u2193<\/p>\n<p>RGBA\u50cf\u7d20\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e09\u3001\u4e3a\u4ec0\u4e48\u56fe\u7247\u7f16\u8f91\u5fc5\u987b\u7ecf\u8fc7 PixelMap&#xff1f;<\/h2>\n<p>\u8fd9\u662f HarmonyOS \u56fe\u7247\u5f00\u53d1\u4e2d\u7684\u6838\u5fc3\u3002<\/p>\n<p>\u5f88\u591a\u4eba\u8ba4\u4e3a&#xff1a;<\/p>\n<p>\u201c\u6211\u8981\u88c1\u526a\u56fe\u7247&#xff0c;\u76f4\u63a5\u64cd\u4f5c\u6587\u4ef6\u4e0d\u884c\u5417&#xff1f;\u201d<\/p>\n<p>\u7b54\u6848&#xff1a;<\/p>\n<p>\u4e0d\u884c\u3002<\/p>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>JPEG\u3001PNG \u662f\u7f16\u7801\u683c\u5f0f\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>JPEG \u6587\u4ef6&#xff1a;<\/p>\n<p>\u538b\u7f29\u6570\u636e<\/p>\n<p>DCT\u53d8\u6362<\/p>\n<p>\u91cf\u5316<\/p>\n<p>\u7f16\u7801<\/p>\n<p>\u5b83\u4e0d\u662f&#xff1a;<\/p>\n<p>\u4e8c\u7ef4\u50cf\u7d20\u6570\u7ec4\u3002<\/p>\n<hr \/>\n<p>\u800c PixelMap&#xff1a;<\/p>\n<p>\u624d\u662f\u771f\u6b63&#xff1a;<\/p>\n<p>\u50cf\u7d20\u77e9\u9635<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>PixelMap<\/p>\n<p>[<br \/>\n [R,G,B,A],<br \/>\n [R,G,B,A],<br \/>\n [R,G,B,A]<br \/>\n]<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u6240\u6709\u56fe\u7247\u5904\u7406&#xff1a;<\/p>\n<p>\u6700\u7ec8\u90fd\u4f1a\u8f6c\u6362\u5230 PixelMap\u3002<\/p>\n<p>\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u88c1\u526a<\/li>\n<li>\u65cb\u8f6c<\/li>\n<li>\u7f29\u653e<\/li>\n<li>\u6ee4\u955c<\/li>\n<li>\u9a6c\u8d5b\u514b<\/li>\n<li>AI\u589e\u5f3a<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e09\u5341\u56db\u3001\u4ece PhotoAsset \u521b\u5efa PixelMap<\/h2>\n<p>\u5b8c\u6574\u94fe\u8def&#xff1a;<\/p>\n<p>\u7528\u6237\u9009\u62e9\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>createPixelMap()<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<hr \/>\n<p>\u793a\u610f\u4ee3\u7801&#xff1a;<\/p>\n<p>import image from &#039;&#064;ohos.multimedia.image&#039;;<\/p>\n<p>const imageSource &#061;<br \/>\n    image.createImageSource(fd);<\/p>\n<p>const pixelMap &#061;<br \/>\n    await imageSource.createPixelMap();<\/p>\n<hr \/>\n<p>\u5f97\u5230&#xff1a;<\/p>\n<p>PixelMap \u540e&#xff1a;<\/p>\n<p>\u5c31\u8fdb\u5165&#xff1a;<\/p>\n<p>\u56fe\u7247\u5904\u7406\u9636\u6bb5\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e94\u3001\u5927\u56fe\u7247\u52a0\u8f7d\u95ee\u9898<\/h2>\n<p>\u8fd9\u662f\u4f01\u4e1a\u5f00\u53d1\u5fc5\u987b\u8003\u8651\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u624b\u673a\u62cd\u6444&#xff1a;<\/p>\n<p>\u4e00\u5f20&#xff1a;<\/p>\n<p>8000\u00d76000<\/p>\n<p>\u7167\u7247\u3002<\/p>\n<p>\u5982\u679c\u76f4\u63a5&#xff1a;<\/p>\n<p>createPixelMap()<\/p>\n<p>\u53ef\u80fd&#xff1a;<\/p>\n<p>\u5360\u7528\u5927\u91cf\u5185\u5b58\u3002<\/p>\n<hr \/>\n<p>\u8ba1\u7b97&#xff1a;<\/p>\n<p>RGBA&#xff1a;<\/p>\n<p>\u6bcf\u50cf\u7d20&#xff1a;<\/p>\n<p>4\u5b57\u8282\u3002<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>8000\u00d76000&#xff1a;<\/p>\n<p>8000 \u00d7 6000 \u00d7 4<\/p>\n<p>&#061;192000000 bytes<\/p>\n<p>\u7ea6&#xff1a;<\/p>\n<p>183MB\u3002<\/p>\n<hr \/>\n<p>\u4e00\u5f20\u7167\u7247&#xff1a;<\/p>\n<p>\u5c31\u53ef\u80fd\u63a5\u8fd1&#xff1a;<\/p>\n<p>200MB\u3002<\/p>\n<hr \/>\n<p>\u5982\u679c\u540c\u65f6&#xff1a;<\/p>\n<p>\u6253\u5f00\u591a\u5f20\u3002<\/p>\n<p>\u5bb9\u6613&#xff1a;<\/p>\n<p>\u5185\u5b58\u538b\u529b\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u516d\u3001\u5927\u56fe\u89e3\u7801\u4f18\u5316<\/h2>\n<p>\u6b63\u786e\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u4e0d\u8981\u9ed8\u8ba4\u52a0\u8f7d\u5b8c\u6574\u5c3a\u5bf8\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u53ea\u662f\u9884\u89c8\u3002<\/p>\n<p>\u5c4f\u5e55&#xff1a;<\/p>\n<p>1080P\u3002<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>\u6ca1\u6709\u5fc5\u8981\u52a0\u8f7d&#xff1a;<\/p>\n<p>8000\u00d76000\u3002<\/p>\n<hr \/>\n<p>\u5e94\u8be5&#xff1a;<\/p>\n<p>\u7f29\u653e\u89e3\u7801\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u76ee\u6807&#xff1a;<\/p>\n<p>1080 \u00d7 810<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u539f\u56fe<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>\u8bbe\u7f6e\u76ee\u6807\u5c3a\u5bf8<\/p>\n<p>\u2193<\/p>\n<p>\u751f\u6210\u7f29\u5c0fPixelMap<\/p>\n<hr \/>\n<p>\u4f18\u52bf&#xff1a;<\/p>\n<p>\u5927\u5e45\u964d\u4f4e&#xff1a;<\/p>\n<ul>\n<li>\u5185\u5b58<\/li>\n<li>\u89e3\u7801\u65f6\u95f4<\/li>\n<li>CPU\u6d88\u8017<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e09\u5341\u4e03\u3001\u76f8\u518c\u9884\u89c8\u9875\u9762\u8bbe\u8ba1<\/h2>\n<p>\u4e00\u4e2a\u4f18\u79c0\u56fe\u7247\u9884\u89c8\u9875&#xff1a;<\/p>\n<p>\u4e0d\u4f1a&#xff1a;<\/p>\n<p>\u6253\u5f00\u9875\u9762\u9a6c\u4e0a\u52a0\u8f7d\u539f\u56fe\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u9636\u6bb5&#xff1a;<\/p>\n<p>\u663e\u793a\u7f29\u7565\u56fe\u3002<\/p>\n<p>Thumbnail<\/p>\n<p>\u2193<\/p>\n<p>\u5feb\u901f\u51fa\u73b0<\/p>\n<hr \/>\n<p>\u7b2c\u4e8c\u9636\u6bb5&#xff1a;<\/p>\n<p>\u540e\u53f0\u52a0\u8f7d\u5927\u56fe\u3002<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u66ff\u6362\u7f29\u7565\u56fe<\/p>\n<hr \/>\n<p>\u7528\u6237\u4f53\u9a8c&#xff1a;<\/p>\n<p>\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\u4e91\u76f8\u518c\u3002<\/p>\n<hr \/>\n<p>\u67b6\u6784&#xff1a;<\/p>\n<p>\u8fdb\u5165\u9875\u9762<\/p>\n<p>\u2193<\/p>\n<p>\u663e\u793aThumbnail<\/p>\n<p>\u2193<\/p>\n<p>\u540e\u53f0Decode<\/p>\n<p>\u2193<\/p>\n<p>PixelMap\u5b8c\u6210<\/p>\n<p>\u2193<\/p>\n<p>\u66f4\u65b0UI<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u516b\u3001\u56fe\u7247\u65cb\u8f6c\u5904\u7406<\/h2>\n<p>\u624b\u673a\u62cd\u7167&#xff1a;<\/p>\n<p>\u7ecf\u5e38\u5b58\u5728\u65b9\u5411\u95ee\u9898\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u624b\u673a\u6a2a\u62cd&#xff1a;<\/p>\n<p>\u5b9e\u9645\u50cf\u7d20&#xff1a;<\/p>\n<p>\u53ef\u80fd&#xff1a;<\/p>\n<p>4032\u00d73024\u3002<\/p>\n<p>\u4f46\u662f&#xff1a;<\/p>\n<p>Exif&#xff1a;<\/p>\n<p>\u8bb0\u5f55&#xff1a;<\/p>\n<p>\u65cb\u8f6c90\u5ea6\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u663e\u793a\u524d&#xff1a;<\/p>\n<p>\u9700\u8981\u5904\u7406\u65b9\u5411\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>\u8bfb\u53d6Orientation<\/p>\n<p>\u2193<\/p>\n<p>\u65cb\u8f6cPixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u663e\u793a<\/p>\n<hr \/>\n<p>\u5426\u5219&#xff1a;<\/p>\n<p>\u53ef\u80fd\u51fa\u73b0&#xff1a;<\/p>\n<p>\u56fe\u7247\u5012\u7f6e\u3002<\/p>\n<hr \/>\n<h2>\u4e09\u5341\u4e5d\u3001\u56fe\u7247\u88c1\u526a\u5b9e\u73b0\u601d\u8def<\/h2>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u5934\u50cf\u88c1\u526a\u3002<\/p>\n<p>\u7528\u6237\u9009\u62e9&#xff1a;<\/p>\n<p>\u4e00\u5f20\u7167\u7247\u3002<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>\u62d6\u52a8\u88c1\u526a\u6846\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u8ba1\u7b97\u88c1\u526a\u533a\u57df<\/p>\n<p>\u2193<\/p>\n<p>\u521b\u5efa\u65b0\u7684PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u663e\u793a<\/p>\n<hr \/>\n<p>\u88c1\u526a\u672c\u8d28&#xff1a;<\/p>\n<p>\u5c31\u662f&#xff1a;<\/p>\n<p>\u590d\u5236\u50cf\u7d20\u533a\u57df\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u539f\u56fe&#xff1a;<\/p>\n<p>4000\u00d73000<\/p>\n<p>\u88c1\u526a&#xff1a;<\/p>\n<p>\u4e2d\u5fc3\u533a\u57df&#xff1a;<\/p>\n<p>1000\u00d71000<\/p>\n<hr \/>\n<p>\u751f\u6210&#xff1a;<\/p>\n<p>\u65b0\u7684 PixelMap\u3002<\/p>\n<hr \/>\n<h2>\u56db\u5341\u3001\u56fe\u7247\u538b\u7f29\u6d41\u7a0b<\/h2>\n<p>\u76f8\u518c\u5e94\u7528\u7ecf\u5e38\u9700\u8981&#xff1a;<\/p>\n<p>\u4e0a\u4f20\u56fe\u7247\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u5934\u50cf&#xff1a;<\/p>\n<p>\u9650\u5236&#xff1a;<\/p>\n<p>500KB\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>Resize<\/p>\n<p>\u2193<\/p>\n<p>ImagePacker<\/p>\n<p>\u2193<\/p>\n<p>JPEG\/WebP<\/p>\n<p>\u2193<\/p>\n<p>\u4e0a\u4f20<\/p>\n<hr \/>\n<p>\u6ce8\u610f&#xff1a;<\/p>\n<p>\u538b\u7f29\u4e0d\u662f\u7b80\u5355&#xff1a;<\/p>\n<p>\u964d\u4f4e\u8d28\u91cf\u3002<\/p>\n<p>\u901a\u5e38&#xff1a;<\/p>\n<p>\u5305\u542b&#xff1a;<\/p>\n<p>\u4e24\u4e2a\u6b65\u9aa4\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e00\u6b65&#xff1a;\u5c3a\u5bf8\u538b\u7f29<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>4000\u00d73000<\/p>\n<p>\u53d8\u6210&#xff1a;<\/p>\n<p>1200\u00d7900\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c\u6b65&#xff1a;\u7f16\u7801\u538b\u7f29<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>JPEG Quality&#xff1a;<\/p>\n<p>80\u3002<\/p>\n<hr \/>\n<p>\u8fd9\u6837&#xff1a;<\/p>\n<p>\u8d28\u91cf\u548c\u5927\u5c0f&#xff1a;<\/p>\n<p>\u66f4\u52a0\u5e73\u8861\u3002<\/p>\n<hr \/>\n<h2>\u56db\u5341\u4e00\u3001\u56fe\u7247\u7f16\u8f91\u5668\u67b6\u6784\u8bbe\u8ba1<\/h2>\n<p>\u5982\u679c\u5f00\u53d1\u4e00\u4e2a\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\u7f8e\u56fe\u79c0\u79c0&#xff1a;<\/p>\n<p>\u7684\u56fe\u7247\u7f16\u8f91\u529f\u80fd\u3002<\/p>\n<p>\u67b6\u6784&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>ImageLoader<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>Editor Engine<\/p>\n<p>\u2193<\/p>\n<p>Operation Stack<\/p>\n<p>\u2193<\/p>\n<p>ImagePacker<\/p>\n<p>\u2193<\/p>\n<p>\u4fdd\u5b58<\/p>\n<hr \/>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>Editor Engine&#xff1a;<\/p>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u5404\u79cd\u7f16\u8f91\u80fd\u529b\u3002<\/p>\n<hr \/>\n<p>Operation Stack&#xff1a;<\/p>\n<p>\u8bb0\u5f55&#xff1a;<\/p>\n<p>\u64cd\u4f5c\u5386\u53f2\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u88c1\u526a<\/p>\n<p>\u2193<\/p>\n<p>\u65cb\u8f6c<\/p>\n<p>\u2193<\/p>\n<p>\u6ee4\u955c<\/p>\n<p>\u2193<\/p>\n<p>\u64a4\u9500<\/p>\n<hr \/>\n<h2>\u56db\u5341\u4e8c\u3001\u64a4\u9500\u4e0e\u91cd\u505a\u8bbe\u8ba1<\/h2>\n<p>\u56fe\u7247\u7f16\u8f91&#xff1a;<\/p>\n<p>\u5fc5\u987b\u652f\u6301&#xff1a;<\/p>\n<p>Undo \/ Redo\u3002<\/p>\n<hr \/>\n<p>\u9519\u8bef\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u6bcf\u4e00\u6b65\u4fdd\u5b58\u5b8c\u6574 PixelMap\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>10\u6b65\u64cd\u4f5c\u3002<\/p>\n<p>10\u5f20&#xff1a;<\/p>\n<p>5000\u00d75000\u56fe\u7247\u3002<\/p>\n<p>\u5185\u5b58\u5de8\u5927\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u4fdd\u5b58\u64cd\u4f5c\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Operation:<\/p>\n<p>Crop(x,y,w,h)<\/p>\n<p>Rotate(90)<\/p>\n<p>Filter(&#034;warm&#034;)<\/p>\n<hr \/>\n<p>\u6062\u590d\u65f6&#xff1a;<\/p>\n<p>\u91cd\u65b0\u6267\u884c\u3002<\/p>\n<hr \/>\n<p>\u8fd9\u4e5f\u662f&#xff1a;<\/p>\n<p>\u4e13\u4e1a\u56fe\u7247\u7f16\u8f91\u5668&#xff1a;<\/p>\n<p>\u5e38\u7528\u65b9\u6848\u3002<\/p>\n<hr \/>\n<h2>\u56db\u5341\u4e09\u3001PhotoAccessHelper \u4e0e\u56fe\u7247\u7f16\u8f91\u5b8c\u6574\u95ed\u73af<\/h2>\n<p>\u73b0\u5728\u6574\u4e2a\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u5df2\u7ecf\u5b8c\u6574&#xff1a;<\/p>\n<p>\u4e32\u8d77\u6765&#xff1a;<\/p>\n<p>\u7528\u6237\u9009\u62e9\u7167\u7247<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u2193<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u7f16\u8f91\u5904\u7406<\/p>\n<p>\u2193<\/p>\n<p>ImagePacker<\/p>\n<p>\u2193<\/p>\n<p>\u751f\u6210\u65b0\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper\u4fdd\u5b58<\/p>\n<hr \/>\n<p>\u8fd9\u5c31\u662f&#xff1a;<\/p>\n<p>HarmonyOS NEXT \u56fe\u7247\u5e94\u7528\u7684\u5b8c\u6574\u751f\u547d\u5468\u671f\u3002<\/p>\n<h3>\u56db\u5341\u56db\u3001\u521b\u5efa\u56fe\u7247\u8d44\u6e90&#xff1a;\u5c06\u56fe\u7247\u4fdd\u5b58\u5230\u7cfb\u7edf\u76f8\u518c<\/h3>\n<p>\u524d\u9762\u6211\u4eec\u5df2\u7ecf\u5b8c\u6210\u4e86\u56fe\u7247\u8bfb\u53d6\u548c\u7f16\u8f91\u6d41\u7a0b&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u56fe\u7247\u5904\u7406<\/p>\n<p>\u4f46\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u56fe\u7247\u5e94\u7528\u4e0d\u4ec5\u9700\u8981\u8bfb\u53d6\u56fe\u7247&#xff0c;\u8fd8\u9700\u8981\u5c06\u5904\u7406\u540e\u7684\u7ed3\u679c\u4fdd\u5b58\u56de\u7cfb\u7edf\u76f8\u518c\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>\u56fe\u7247\u7f16\u8f91\u5668\u4fdd\u5b58\u56fe\u7247<\/li>\n<li>\u62cd\u7167\u5e94\u7528\u4fdd\u5b58\u7167\u7247<\/li>\n<li>\u6d77\u62a5\u751f\u6210\u5668\u5bfc\u51fa\u56fe\u7247<\/li>\n<li>\u622a\u56fe\u5de5\u5177\u4fdd\u5b58\u622a\u56fe<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u573a\u666f\u6700\u7ec8\u90fd\u9700\u8981\u521b\u5efa\u65b0\u7684\u5a92\u4f53\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<p>\u5728 HarmonyOS NEXT \u4e2d&#xff0c;\u5e94\u7528\u4e0d\u80fd\u7b80\u5355\u5730&#xff1a;<\/p>\n<p>\u521b\u5efa\u6587\u4ef6<\/p>\n<p>\u2193<\/p>\n<p>\u5199\u5165 DCIM \u6587\u4ef6\u5939<\/p>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u7ed5\u8fc7\u7cfb\u7edf\u5a92\u4f53\u7ba1\u7406\u3002<\/p>\n<p>\u6b63\u786e\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u901a\u8fc7&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u2193<\/p>\n<p>createAsset()<\/p>\n<p>\u2193<\/p>\n<p>\u5199\u5165\u56fe\u7247\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>\u7cfb\u7edf\u5a92\u4f53\u5e93\u7ba1\u7406<\/p>\n<hr \/>\n<p>\u6574\u4f53\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7f16\u8f91\u540e\u7684 PixelMap<\/p>\n<p>        \u2193<\/p>\n<p>ImagePacker\u7f16\u7801<\/p>\n<p>        \u2193<\/p>\n<p>JPEG\/PNG\u6570\u636e<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAccessHelper\u521b\u5efa\u8d44\u6e90<\/p>\n<p>        \u2193<\/p>\n<p>\u5199\u5165\u5a92\u4f53\u5e93<\/p>\n<p>        \u2193<\/p>\n<p>\u7cfb\u7edf\u76f8\u518c\u663e\u793a<\/p>\n<hr \/>\n<h2>\u56db\u5341\u4e94\u3001\u4e3a\u4ec0\u4e48\u4fdd\u5b58\u56fe\u7247\u5fc5\u987b\u7ecf\u8fc7 PhotoAccessHelper&#xff1f;<\/h2>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u4f1a\u95ee&#xff1a;<\/p>\n<p>\u201c\u6211\u5df2\u7ecf\u6709 JPEG \u6570\u636e\u4e86&#xff0c;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u4fdd\u5b58\u6587\u4ef6&#xff1f;\u201d<\/p>\n<p>\u539f\u56e0\u662f&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u76f8\u518c\u4e0d\u662f\u666e\u901a\u6587\u4ef6\u5939\u3002<\/p>\n<p>\u5b83\u7ef4\u62a4&#xff1a;<\/p>\n<ul>\n<li>\u5a92\u4f53\u7d22\u5f15<\/li>\n<li>\u7f29\u7565\u56fe<\/li>\n<li>\u5143\u6570\u636e<\/li>\n<li>\u6743\u9650\u4fe1\u606f<\/li>\n<li>\u76f8\u518c\u5173\u7cfb<\/li>\n<\/ul>\n<p>\u5982\u679c\u76f4\u63a5\u5199\u6587\u4ef6&#xff1a;<\/p>\n<p>\u53ef\u80fd\u51fa\u73b0&#xff1a;<\/p>\n<p>\u6587\u4ef6\u5b58\u5728<\/p>\n<p>\u4f46\u662f<\/p>\n<p>\u7cfb\u7edf\u76f8\u518c\u770b\u4e0d\u5230<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u5e94\u7528\u6267\u884c&#xff1a;<\/p>\n<p>\u5199\u5165&#xff1a;<\/p>\n<p>\/Pictures\/test.jpg<\/p>\n<p>\u6587\u4ef6\u786e\u5b9e\u5b58\u5728\u3002<\/p>\n<p>\u4f46\u662f&#xff1a;<\/p>\n<p>\u5a92\u4f53\u5e93\u4e0d\u77e5\u9053&#xff1a;<\/p>\n<p>\u201c\u8fd9\u91cc\u65b0\u589e\u4e86\u4e00\u5f20\u56fe\u7247\u201d\u3002<\/p>\n<hr \/>\n<p>\u901a\u8fc7 PhotoAccessHelper&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5b8c\u6210&#xff1a;<\/p>\n<p>\u521b\u5efa\u8bb0\u5f55<\/p>\n<p>\u2193<\/p>\n<p>\u4fdd\u5b58\u5a92\u4f53\u4fe1\u606f<\/p>\n<p>\u2193<\/p>\n<p>\u66f4\u65b0\u7d22\u5f15<\/p>\n<p>\u2193<\/p>\n<p>\u901a\u77e5\u56fe\u5e93<\/p>\n<hr \/>\n<h2>\u56db\u5341\u516d\u3001\u521b\u5efa\u56fe\u7247\u8d44\u6e90\u6d41\u7a0b<\/h2>\n<p>\u5b8c\u6574\u8fc7\u7a0b&#xff1a;<\/p>\n<p>\u5206\u4e3a\u4e09\u4e2a\u9636\u6bb5\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e00\u9636\u6bb5&#xff1a;\u521b\u5efa\u5a92\u4f53\u8bb0\u5f55<\/h3>\n<p>\u544a\u8bc9\u7cfb\u7edf&#xff1a;<\/p>\n<p>\u6211\u8981\u4fdd\u5b58\u4e00\u5f20\u56fe\u7247\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u540d\u79f0&#xff1a;<\/p>\n<p>edit_photo.jpg<\/p>\n<p>\u7c7b\u578b&#xff1a;<\/p>\n<p>IMAGE<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c\u9636\u6bb5&#xff1a;\u5199\u5165\u56fe\u7247\u6570\u636e<\/h3>\n<p>\u5c06&#xff1a;<\/p>\n<p>JPEG\/PNG\u4e8c\u8fdb\u5236\u6570\u636e<\/p>\n<p>\u5199\u5165\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09\u9636\u6bb5&#xff1a;\u5b8c\u6210\u63d0\u4ea4<\/h3>\n<p>\u7cfb\u7edf\u66f4\u65b0&#xff1a;<\/p>\n<p>\u5a92\u4f53\u5e93\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>createAsset<\/p>\n<p>\u2193<\/p>\n<p>open<\/p>\n<p>\u2193<\/p>\n<p>write<\/p>\n<p>\u2193<\/p>\n<p>close<\/p>\n<p>\u2193<\/p>\n<p>\u56fe\u5e93\u5237\u65b0<\/p>\n<hr \/>\n<h2>\u56db\u5341\u4e03\u3001ImagePacker \u7f16\u7801\u56fe\u7247<\/h2>\n<p>PixelMap \u662f\u5185\u5b58\u4e2d\u7684\u50cf\u7d20\u3002<\/p>\n<p>\u7cfb\u7edf\u76f8\u518c\u4e0d\u80fd\u76f4\u63a5\u4fdd\u5b58 PixelMap\u3002<\/p>\n<p>\u5fc5\u987b\u7f16\u7801\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>PixelMap&#xff1a;<\/p>\n<p>RGBA\u50cf\u7d20<\/p>\n<p>\u2193<\/p>\n<p>ImagePacker<\/p>\n<p>\u2193<\/p>\n<p>JPEG<\/p>\n<p>\u2193<\/p>\n<p>\u4e8c\u8fdb\u5236\u6570\u636e<\/p>\n<hr \/>\n<p>\u4e3a\u4ec0\u4e48\u9700\u8981\u7f16\u7801&#xff1f;<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>PixelMap&#xff1a;<\/p>\n<p>\u9002\u5408\u7a0b\u5e8f\u5904\u7406\u3002<\/p>\n<p>JPEG&#xff1a;<\/p>\n<p>\u9002\u5408\u5b58\u50a8\u3002<\/p>\n<hr \/>\n<p>\u5173\u7cfb&#xff1a;<\/p>\n<p>PixelMap<\/p>\n<p>(\u5185\u5b58\u683c\u5f0f)<\/p>\n<p>        \u2193<\/p>\n<p>ImagePacker<\/p>\n<p>        \u2193<\/p>\n<p>JPEG<\/p>\n<p>(\u6587\u4ef6\u683c\u5f0f)<\/p>\n<hr \/>\n<h2>\u56db\u5341\u516b\u3001JPEG \u4e0e PNG \u5982\u4f55\u9009\u62e9&#xff1f;<\/h2>\n<p>\u4fdd\u5b58\u56fe\u7247\u65f6&#xff1a;<\/p>\n<p>\u683c\u5f0f\u9009\u62e9\u5f88\u91cd\u8981\u3002<\/p>\n<hr \/>\n<h3>JPEG<\/h3>\n<p>\u9002\u5408&#xff1a;<\/p>\n<ul>\n<li>\u76f8\u673a\u7167\u7247<\/li>\n<li>\u98ce\u666f\u7167\u7247<\/li>\n<li>\u4eba\u50cf\u7167\u7247<\/li>\n<\/ul>\n<p>\u7279\u70b9&#xff1a;<\/p>\n<p>\u6587\u4ef6\u5c0f\u3002<\/p>\n<p>\u4f46\u662f&#xff1a;<\/p>\n<p>\u6709\u635f\u538b\u7f29\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u539f\u56fe&#xff1a;<\/p>\n<p>10MB\u3002<\/p>\n<p>JPEG&#xff1a;<\/p>\n<p>\u53ef\u80fd&#xff1a;<\/p>\n<p>1MB\u3002<\/p>\n<hr \/>\n<h3>PNG<\/h3>\n<p>\u9002\u5408&#xff1a;<\/p>\n<ul>\n<li>\u622a\u56fe<\/li>\n<li>UI\u56fe\u7247<\/li>\n<li>\u900f\u660e\u56fe\u7247<\/li>\n<\/ul>\n<p>\u7279\u70b9&#xff1a;<\/p>\n<p>\u65e0\u635f\u3002<\/p>\n<p>\u652f\u6301\u900f\u660e\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Logo&#xff1a;<\/p>\n<p>\u9700\u8981&#xff1a;<\/p>\n<p>Alpha\u901a\u9053\u3002<\/p>\n<hr \/>\n<h3>WebP<\/h3>\n<p>\u73b0\u4ee3\u5e94\u7528\u5e38\u7528\u3002<\/p>\n<p>\u4f18\u52bf&#xff1a;<\/p>\n<p>\u5728\u76f8\u540c\u8d28\u91cf\u4e0b&#xff1a;<\/p>\n<p>\u6bd4 JPEG \u66f4\u5c0f\u3002<\/p>\n<p>\u9002\u5408&#xff1a;<\/p>\n<p>\u79fb\u52a8\u7aef\u4e0a\u4f20\u3002<\/p>\n<hr \/>\n<h2>\u56db\u5341\u4e5d\u3001\u4fdd\u5b58\u7f16\u8f91\u56fe\u7247\u5b8c\u6574\u6848\u4f8b<\/h2>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>\u7528\u6237&#xff1a;<\/p>\n<p>\u9009\u62e9\u56fe\u7247\u3002<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>\u6dfb\u52a0\u6ee4\u955c\u3002<\/p>\n<p>\u70b9\u51fb&#xff1a;<\/p>\n<p>\u4fdd\u5b58\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7528\u6237\u70b9\u51fb\u4fdd\u5b58<\/p>\n<p>\u2193<\/p>\n<p>\u83b7\u53d6\u7f16\u8f91\u540e\u7684PixelMap<\/p>\n<p>\u2193<\/p>\n<p>ImagePacker\u7f16\u7801<\/p>\n<p>\u2193<\/p>\n<p>\u751f\u6210JPEG\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper\u521b\u5efaAsset<\/p>\n<p>\u2193<\/p>\n<p>\u5199\u5165\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>\u7cfb\u7edf\u76f8\u518c\u51fa\u73b0\u65b0\u56fe\u7247<\/p>\n<hr \/>\n<p>\u8fd9\u4e2a\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u5c31\u662f&#xff1a;<\/p>\n<p>\u56fe\u7247\u7f16\u8f91 App \u7684\u6838\u5fc3\u95ed\u73af\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u5341\u3001\u6279\u91cf\u5bfc\u5165\u56fe\u7247\u8bbe\u8ba1<\/h2>\n<p>\u5f88\u591a\u5e94\u7528\u9700\u8981&#xff1a;<\/p>\n<p>\u6279\u91cf\u4fdd\u5b58\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<ul>\n<li>\u4e91\u76d8\u4e0b\u8f7d100\u5f20\u56fe\u7247<\/li>\n<li>\u804a\u5929\u56fe\u7247\u5bfc\u51fa<\/li>\n<li>\u76f8\u518c\u5907\u4efd\u6062\u590d<\/li>\n<\/ul>\n<hr \/>\n<p>\u9519\u8bef\u65b9\u5f0f&#xff1a;<\/p>\n<p>100\u5f20\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>100\u4e2a\u4fdd\u5b58\u4efb\u52a1\u540c\u65f6\u6267\u884c<\/p>\n<hr \/>\n<p>\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>CPU\u538b\u529b\u5927<\/li>\n<li>IO\u7ade\u4e89<\/li>\n<li>\u5185\u5b58\u4e0a\u6da8<\/li>\n<\/ul>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u4efb\u52a1\u961f\u5217\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Task Queue<\/p>\n<p>    |<\/p>\n<p>    |<\/p>\n<p>Worker<\/p>\n<p>    |<\/p>\n<p>    |<\/p>\n<p>PhotoAccessHelper<\/p>\n<hr \/>\n<p>\u63a7\u5236\u5e76\u53d1&#xff1a;<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u540c\u65f6\u5904\u7406&#xff1a;<\/p>\n<p>3&#xff5e;5\u5f20\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u5341\u4e00\u3001\u6279\u91cf\u4fdd\u5b58\u6027\u80fd\u4f18\u5316<\/h2>\n<p>\u6279\u91cf\u56fe\u7247\u4fdd\u5b58&#xff1a;<\/p>\n<p>\u4e3b\u8981\u74f6\u9888&#xff1a;<\/p>\n<h3>1. \u7f16\u7801<\/h3>\n<p>PixelMap \u2192 JPEG<\/p>\n<hr \/>\n<h3>2. IO\u5199\u5165<\/h3>\n<p>\u6570\u636e\u4fdd\u5b58\u3002<\/p>\n<hr \/>\n<h3>3. \u5a92\u4f53\u5e93\u66f4\u65b0<\/h3>\n<p>\u7cfb\u7edf\u7d22\u5f15\u3002<\/p>\n<hr \/>\n<p>\u4f18\u5316\u7b56\u7565&#xff1a;<\/p>\n<hr \/>\n<h4>\u7b2c\u4e00<\/h4>\n<p>\u964d\u4f4e\u65e0\u610f\u4e49\u5c3a\u5bf8\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u539f\u56fe&#xff1a;<\/p>\n<p>6000\u00d74000\u3002<\/p>\n<p>\u4e0a\u4f20&#xff1a;<\/p>\n<p>\u53ea\u9700\u8981&#xff1a;<\/p>\n<p>1200\u00d7800\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e8c<\/h4>\n<p>\u7edf\u4e00\u540e\u53f0\u5904\u7406\u3002<\/p>\n<p>\u4e0d\u8981\u963b\u585e UI\u3002<\/p>\n<hr \/>\n<h4>\u7b2c\u4e09<\/h4>\n<p>\u63a7\u5236\u4efb\u52a1\u6570\u91cf\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u5341\u4e8c\u3001\u5220\u9664\u56fe\u7247\u8d44\u6e90<\/h2>\n<p>\u76f8\u518c\u5e94\u7528\u7ecf\u5e38\u9700\u8981&#xff1a;<\/p>\n<p>\u5220\u9664\u56fe\u7247\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u70b9\u51fb&#xff1a;<\/p>\n<p>\u5220\u9664\u6309\u94ae\u3002<\/p>\n<hr \/>\n<p>HarmonyOS \u4e0d\u63a8\u8350&#xff1a;<\/p>\n<p>\u76f4\u63a5\u5220\u9664\u6587\u4ef6\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u901a\u8fc7&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u5220\u9664\u5a92\u4f53\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u7528\u6237\u9009\u62e9\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>\u83b7\u53d6PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>deleteAssets()<\/p>\n<p>\u2193<\/p>\n<p>\u7cfb\u7edf\u786e\u8ba4<\/p>\n<p>\u2193<\/p>\n<p>\u5a92\u4f53\u5e93\u5220\u9664<\/p>\n<hr \/>\n<p>\u4e3a\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u56e0\u4e3a\u5220\u9664\u4e0d\u4ec5\u4ec5\u662f\u5220\u9664\u6587\u4ef6\u3002<\/p>\n<p>\u8fd8\u9700\u8981&#xff1a;<\/p>\n<p>\u540c\u6b65&#xff1a;<\/p>\n<ul>\n<li>\u6570\u636e\u5e93<\/li>\n<li>\u7f29\u7565\u56fe<\/li>\n<li>\u7d22\u5f15<\/li>\n<li>\u76f8\u518c\u5173\u7cfb<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e94\u5341\u4e09\u3001\u5220\u9664\u56fe\u7247\u540e\u7684\u72b6\u6001\u5904\u7406<\/h2>\n<p>\u5220\u9664\u4e4b\u540e&#xff1a;<\/p>\n<p>\u5e94\u7528\u9700\u8981\u5237\u65b0\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u5f53\u524d\u5217\u8868&#xff1a;<\/p>\n<p>photo1<\/p>\n<p>photo2<\/p>\n<p>photo3<\/p>\n<p>\u7528\u6237\u5220\u9664&#xff1a;<\/p>\n<p>photo2\u3002<\/p>\n<hr \/>\n<p>\u9700\u8981&#xff1a;<\/p>\n<p>\u66f4\u65b0&#xff1a;<\/p>\n<p>photo1<\/p>\n<p>photo3<\/p>\n<hr \/>\n<p>\u4e0d\u8981&#xff1a;<\/p>\n<p>\u7b49\u5f85\u91cd\u65b0\u67e5\u8be2\u6574\u4e2a\u76f8\u518c\u3002<\/p>\n<hr \/>\n<p>\u66f4\u597d\u7684\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u5c40\u90e8\u66f4\u65b0\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u5220\u9664\u6210\u529f<\/p>\n<p>\u2193<\/p>\n<p>\u79fb\u9664\u5bf9\u5e94PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>\u5237\u65b0\u5217\u8868<\/p>\n<hr \/>\n<h2>\u4e94\u5341\u56db\u3001\u76f8\u518c\u56de\u6536\u7ad9\u8bbe\u8ba1<\/h2>\n<p>\u73b0\u4ee3\u7cfb\u7edf\u901a\u5e38\u4e0d\u4f1a\u7acb\u5373\u6c38\u4e45\u5220\u9664\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7167\u7247 App&#xff1a;<\/p>\n<p>\u5220\u9664&#xff1a;<\/p>\n<p>\u8fdb\u5165&#xff1a;<\/p>\n<p>\u6700\u8fd1\u5220\u9664\u3002<\/p>\n<hr \/>\n<p>\u5e94\u7528\u5982\u679c\u5b9e\u73b0\u7c7b\u4f3c\u529f\u80fd&#xff1a;<\/p>\n<p>\u9700\u8981\u8bbe\u8ba1&#xff1a;<\/p>\n<p>\u72b6\u6001\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u6b63\u5e38<\/p>\n<p>\u2193<\/p>\n<p>\u5220\u9664\u6807\u8bb0<\/p>\n<p>\u2193<\/p>\n<p>\u56de\u6536\u7ad9<\/p>\n<p>\u2193<\/p>\n<p>\u6c38\u4e45\u5220\u9664<\/p>\n<hr \/>\n<p>\u6570\u636e\u5e93\u601d\u60f3&#xff1a;<\/p>\n<p>\u589e\u52a0&#xff1a;<\/p>\n<p>\u72b6\u6001\u5b57\u6bb5\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>status:<\/p>\n<p>normal<\/p>\n<p>deleted<\/p>\n<hr \/>\n<h2>\u4e94\u5341\u4e94\u3001\u6743\u9650\u6700\u4f73\u5b9e\u8df5<\/h2>\n<p>\u76f8\u518c\u6743\u9650\u662f\u7528\u6237\u4fe1\u4efb\u7684\u91cd\u8981\u90e8\u5206\u3002<\/p>\n<hr \/>\n<p>\u4e0d\u8981&#xff1a;<\/p>\n<p>App\u542f\u52a8&#xff1a;<\/p>\n<p>\u7acb\u5373\u7533\u8bf7\u3002<\/p>\n<hr \/>\n<p>\u63a8\u8350&#xff1a;<\/p>\n<p>\u7528\u6237\u884c\u4e3a\u89e6\u53d1\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u70b9\u51fb&#xff1a;<\/p>\n<p>\u201c\u4e0a\u4f20\u56fe\u7247\u201d\u3002<\/p>\n<p>\u6b64\u65f6&#xff1a;<\/p>\n<p>\u7533\u8bf7&#xff1a;<\/p>\n<p>\u8bfb\u53d6\u6743\u9650\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u70b9\u51fb\u4e0a\u4f20<\/p>\n<p>\u2193<\/p>\n<p>\u89e3\u91ca\u7528\u9014<\/p>\n<p>\u2193<\/p>\n<p>\u7533\u8bf7\u6743\u9650<\/p>\n<p>\u2193<\/p>\n<p>\u7528\u6237\u5141\u8bb8<\/p>\n<p>\u2193<\/p>\n<p>\u6253\u5f00\u76f8\u518c<\/p>\n<hr \/>\n<h2>\u4e94\u5341\u516d\u3001\u5f02\u5e38\u5904\u7406\u8bbe\u8ba1<\/h2>\n<p>\u771f\u5b9e\u73af\u5883\u4e2d&#xff1a;<\/p>\n<p>\u5fc5\u987b\u8003\u8651&#xff1a;<\/p>\n<p>\u5931\u8d25\u60c5\u51b5\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<h3>\u6743\u9650\u62d2\u7edd<\/h3>\n<p>\u7528\u6237\u70b9\u51fb&#xff1a;<\/p>\n<p>\u201c\u4e0d\u5141\u8bb8\u201d\u3002<\/p>\n<p>\u5904\u7406&#xff1a;<\/p>\n<p>\u663e\u793a\u63d0\u793a\u3002<\/p>\n<hr \/>\n<h3>\u56fe\u7247\u88ab\u5220\u9664<\/h3>\n<p>\u7528\u6237\u67e5\u8be2\u540e&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u5220\u9664\u3002<\/p>\n<p>\u5904\u7406&#xff1a;<\/p>\n<p>\u91cd\u65b0\u5237\u65b0\u3002<\/p>\n<hr \/>\n<h3>\u6587\u4ef6\u635f\u574f<\/h3>\n<p>ImageSource\u89e3\u6790\u5931\u8d25\u3002<\/p>\n<p>\u5904\u7406&#xff1a;<\/p>\n<p>\u8df3\u8fc7\u3002<\/p>\n<hr \/>\n<h3>\u5185\u5b58\u4e0d\u8db3<\/h3>\n<p>\u5927\u56fe\u52a0\u8f7d\u5931\u8d25\u3002<\/p>\n<p>\u5904\u7406&#xff1a;<\/p>\n<p>\u964d\u4f4e\u89e3\u7801\u5c3a\u5bf8\u3002<\/p>\n<hr \/>\n<h2>\u4e94\u5341\u4e03\u3001\u56fe\u7247\u4e0a\u4f20\u524d\u5904\u7406\u67b6\u6784<\/h2>\n<p>\u5f88\u591a\u4e1a\u52a1&#xff1a;<\/p>\n<p>\u4e0d\u662f\u4fdd\u5b58\u3002<\/p>\n<p>\u800c\u662f&#xff1a;<\/p>\n<p>\u4e0a\u4f20\u670d\u52a1\u5668\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u5934\u50cf\u4e0a\u4f20\u3002<\/p>\n<hr \/>\n<p>\u5b8c\u6574\u6d41\u7a0b&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u538b\u7f29<\/p>\n<p>\u2193<\/p>\n<p>ImagePacker<\/p>\n<p>\u2193<\/p>\n<p>Base64 \/ File<\/p>\n<p>\u2193<\/p>\n<p>HTTP\u4e0a\u4f20<\/p>\n<hr \/>\n<p>\u4e0d\u8981&#xff1a;<\/p>\n<p>\u76f4\u63a5\u4e0a\u4f20\u539f\u56fe\u3002<\/p>\n<hr \/>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<ul>\n<li>\u6d41\u91cf\u5927<\/li>\n<li>\u4e0a\u4f20\u6162<\/li>\n<li>\u670d\u52a1\u5668\u538b\u529b\u9ad8<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e94\u5341\u516b\u3001\u4f01\u4e1a\u7ea7\u56fe\u7247\u4e0a\u4f20\u7b56\u7565<\/h2>\n<p>\u63a8\u8350&#xff1a;<\/p>\n<p>\u5ba2\u6237\u7aef&#xff1a;<\/p>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b21\u538b\u7f29\u3002<\/p>\n<p>\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u6700\u7ec8\u5904\u7406\u3002<\/p>\n<hr \/>\n<p>\u67b6\u6784&#xff1a;<\/p>\n<p>\u624b\u673a\u7aef<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u538b\u7f29<\/p>\n<p>\u2193<\/p>\n<p>\u4e0a\u4f20<\/p>\n<p>\u670d\u52a1\u5668<\/p>\n<p>\u2193<\/p>\n<p>\u4e8c\u6b21\u5904\u7406<\/p>\n<p>\u2193<\/p>\n<p>CDN<\/p>\n<hr \/>\n<p>\u8fd9\u6837&#xff1a;<\/p>\n<p>\u517c\u987e&#xff1a;<\/p>\n<p>\u901f\u5ea6\u548c\u8d28\u91cf\u3002<\/p>\n<h2>\u516d\u5341\u4e00\u3001\u4f01\u4e1a\u7ea7\u76f8\u518c\u6574\u4f53\u67b6\u6784<\/h2>\n<p>\u4e00\u4e2a\u6210\u719f\u7684 HarmonyOS \u76f8\u518c\u6a21\u5757\u901a\u5e38\u5206\u4e3a\u591a\u4e2a\u5c42\u7ea7\u3002<\/p>\n<p>\u63a8\u8350\u67b6\u6784&#xff1a;<\/p>\n<p>Gallery UI<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>Gallery ViewModel<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>Photo Repository<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>PhotoAccessService<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>System Media Library<\/p>\n<hr \/>\n<p>\u6bcf\u4e00\u5c42\u804c\u8d23\u4e0d\u540c\u3002<\/p>\n<hr \/>\n<h3>UI \u5c42<\/h3>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u56fe\u7247\u5c55\u793a<\/li>\n<li>Grid\u5e03\u5c40<\/li>\n<li>\u7528\u6237\u4ea4\u4e92<\/li>\n<li>\u6eda\u52a8\u72b6\u6001<\/li>\n<\/ul>\n<p>\u4e0d\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u67e5\u8be2\u76f8\u518c<\/li>\n<li>\u56fe\u7247\u89e3\u7801<\/li>\n<li>\u6587\u4ef6\u5904\u7406<\/li>\n<\/ul>\n<hr \/>\n<h3>ViewModel \u5c42<\/h3>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u9875\u9762\u72b6\u6001\u7ba1\u7406<\/li>\n<li>\u52a0\u8f7d\u72b6\u6001<\/li>\n<li>\u5206\u9875\u63a7\u5236<\/li>\n<li>\u9519\u8bef\u5904\u7406<\/li>\n<\/ul>\n<hr \/>\n<h3>Repository \u5c42<\/h3>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u6570\u636e\u6765\u6e90\u7edf\u4e00<\/li>\n<li>\u7f13\u5b58\u7ba1\u7406<\/li>\n<li>\u67e5\u8be2\u5c01\u88c5<\/li>\n<\/ul>\n<hr \/>\n<h3>PhotoAccessService \u5c42<\/h3>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>HarmonyOS API\u5c01\u88c5<\/li>\n<li>\u6743\u9650\u5904\u7406<\/li>\n<li>\u5a92\u4f53\u8bbf\u95ee<\/li>\n<\/ul>\n<hr \/>\n<h2>\u516d\u5341\u4e8c\u3001\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u8ba9 UI \u76f4\u63a5\u8c03\u7528 PhotoAccessHelper&#xff1f;<\/h2>\n<p>\u5f88\u591a Demo \u4f1a\u8fd9\u6837\u5199&#xff1a;<\/p>\n<p>\u9875\u9762<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u2193<\/p>\n<p>\u67e5\u8be2\u56fe\u7247<\/p>\n<p>\u5c0f\u9879\u76ee\u6ca1\u6709\u95ee\u9898\u3002<\/p>\n<p>\u4f46\u662f\u5927\u578b\u9879\u76ee\u4f1a\u4ea7\u751f\u5927\u91cf\u95ee\u9898\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u9875\u9762\u4ee3\u7801&#xff1a;<\/p>\n<p>&#064;Component<br \/>\nstruct Gallery {<\/p>\n<p>    loadPhotos(){<\/p>\n<p>        helper.getAssets()<\/p>\n<p>    }<br \/>\n}<\/p>\n<p>\u95ee\u9898&#xff1a;<\/p>\n<li>UI \u548c\u7cfb\u7edf API \u5f3a\u8026\u5408<\/li>\n<li>\u65e0\u6cd5\u6d4b\u8bd5<\/li>\n<li>\u65e0\u6cd5\u66ff\u6362\u6570\u636e\u6e90<\/li>\n<li>\u7f13\u5b58\u903b\u8f91\u6df7\u4e71<\/li>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>UI<\/p>\n<p>\u2193<\/p>\n<p>ViewModel<\/p>\n<p>\u2193<\/p>\n<p>Repository<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<hr \/>\n<p>\u8fd9\u6837&#xff1a;<\/p>\n<p>\u672a\u6765\u589e\u52a0&#xff1a;<\/p>\n<ul>\n<li>\u4e91\u7aef\u56fe\u7247<\/li>\n<li>\u7f51\u7edc\u76f8\u518c<\/li>\n<li>\u672c\u5730\u7f13\u5b58<\/li>\n<\/ul>\n<p>\u90fd\u5bb9\u6613\u6269\u5c55\u3002<\/p>\n<hr \/>\n<h2>\u516d\u5341\u4e09\u3001\u767e\u4e07\u7ea7\u56fe\u7247\u67e5\u8be2\u7b56\u7565<\/h2>\n<p>\u771f\u5b9e\u7528\u6237&#xff1a;<\/p>\n<p>\u53ef\u80fd\u6709&#xff1a;<\/p>\n<p>\u51e0\u4e07\u5f20\u7167\u7247\u3002<\/p>\n<p>\u4f01\u4e1a\u5e94\u7528&#xff1a;<\/p>\n<p>\u751a\u81f3&#xff1a;<\/p>\n<p>\u7ba1\u7406\u767e\u4e07\u7ea7\u56fe\u7247\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<p>\u6838\u5fc3\u539f\u5219&#xff1a;<\/p>\n<p>\u4e0d\u8981\u52a0\u8f7d\u5168\u90e8\u3002<\/p>\n<hr \/>\n<p>\u9519\u8bef&#xff1a;<\/p>\n<p>\u67e5\u8be2100000\u5f20<\/p>\n<p>\u2193<\/p>\n<p>\u4fdd\u5b58\u6570\u7ec4<\/p>\n<p>\u2193<\/p>\n<p>\u663e\u793a<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u91c7\u7528&#xff1a;<\/p>\n<p>\u5206\u9875 &#043; \u6e38\u6807\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b21&#xff1a;<\/p>\n<p>offset &#061; 0<\/p>\n<p>limit &#061; 50<\/p>\n<p>\u8fd4\u56de&#xff1a;<\/p>\n<p>50\u5f20\u3002<\/p>\n<hr \/>\n<p>\u7b2c\u4e8c\u6b21&#xff1a;<\/p>\n<p>offset &#061; 50<\/p>\n<p>limit &#061; 50<\/p>\n<p>\u7ee7\u7eed\u52a0\u8f7d\u3002<\/p>\n<hr \/>\n<p>\u5f62\u6210&#xff1a;<\/p>\n<p>\u6d41\u5f0f\u52a0\u8f7d\u3002<\/p>\n<hr \/>\n<h2>\u516d\u5341\u56db\u3001\u76f8\u518c\u6570\u636e\u5206\u9875\u72b6\u6001\u7ba1\u7406<\/h2>\n<p>ViewModel \u4e2d&#xff1a;<\/p>\n<p>\u901a\u5e38\u7ef4\u62a4&#xff1a;<\/p>\n<p>class GalleryState {<\/p>\n<p>    assets: PhotoAsset[];<\/p>\n<p>    page: number;<\/p>\n<p>    loading: boolean;<\/p>\n<p>    hasMore: boolean;<\/p>\n<p>}<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u521d\u59cb&#xff1a;<\/p>\n<p>page &#061; 1<\/p>\n<p>assets &#061; []<\/p>\n<p>loading &#061; false<\/p>\n<hr \/>\n<p>\u7528\u6237\u6253\u5f00\u9875\u9762&#xff1a;<\/p>\n<p>loading&#061;true<\/p>\n<p>\u2193<\/p>\n<p>\u67e5\u8be2\u7b2c\u4e00\u9875<\/p>\n<p>\u2193<\/p>\n<p>\u8ffd\u52a0\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>loading&#061;false<\/p>\n<hr \/>\n<p>\u7528\u6237\u6ed1\u5230\u5e95&#xff1a;<\/p>\n<p>\u7ee7\u7eed&#xff1a;<\/p>\n<p>page&#043;&#043;<\/p>\n<p>\u2193<\/p>\n<p>\u52a0\u8f7d\u4e0b\u4e00\u9875<\/p>\n<hr \/>\n<h2>\u516d\u5341\u4e94\u3001Thumbnail \u52a0\u8f7d\u7cfb\u7edf\u8bbe\u8ba1<\/h2>\n<p>\u76f8\u518c\u4f53\u9a8c\u597d\u4e0d\u597d&#xff0c;\u6838\u5fc3\u4e0d\u662f\u67e5\u8be2\u3002<\/p>\n<p>\u800c\u662f\u56fe\u7247\u663e\u793a\u901f\u5ea6\u3002<\/p>\n<hr \/>\n<p>\u7528\u6237\u6253\u5f00\u76f8\u518c&#xff1a;<\/p>\n<p>\u5e0c\u671b&#xff1a;<\/p>\n<p>\u9a6c\u4e0a\u770b\u5230\u56fe\u7247\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u9700\u8981&#xff1a;<\/p>\n<p>Thumbnail Manager\u3002<\/p>\n<hr \/>\n<p>\u67b6\u6784&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>ThumbnailManager<\/p>\n<p>    |<\/p>\n<p>    \u251c\u2500\u2500 Memory Cache<\/p>\n<p>    |<\/p>\n<p>    \u2514\u2500\u2500 Disk Cache<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>Image Component<\/p>\n<hr \/>\n<h2>\u516d\u5341\u516d\u3001\u4e24\u7ea7\u56fe\u7247\u7f13\u5b58\u8bbe\u8ba1<\/h2>\n<p>\u5927\u578b\u56fe\u7247\u5e94\u7528&#xff1a;<\/p>\n<p>\u901a\u5e38\u4f7f\u7528&#xff1a;<\/p>\n<p>\u4e24\u7ea7\u7f13\u5b58\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u7ea7\u7f13\u5b58&#xff1a;\u5185\u5b58\u7f13\u5b58<\/h3>\n<p>\u901f\u5ea6\u6700\u5feb\u3002<\/p>\n<p>\u4fdd\u5b58&#xff1a;<\/p>\n<p>\u6700\u8fd1\u4f7f\u7528\u56fe\u7247\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>URI<\/p>\n<p>\u2193<\/p>\n<p>PixelMap\u7f29\u7565\u56fe<\/p>\n<hr \/>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<p>\u8bbf\u95ee\u901f\u5ea6&#xff1a;<\/p>\n<p>\u6beb\u79d2\u7ea7\u3002<\/p>\n<hr \/>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<p>\u5360\u7528\u5185\u5b58\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u7ea7\u7f13\u5b58&#xff1a;\u78c1\u76d8\u7f13\u5b58<\/h3>\n<p>\u4fdd\u5b58&#xff1a;<\/p>\n<p>\u5df2\u7ecf\u751f\u6210\u7684\u7f29\u7565\u56fe\u6587\u4ef6\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>cache\/<\/p>\n<p>    photo1.thumb<\/p>\n<p>    photo2.thumb<\/p>\n<hr \/>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<p>\u9000\u51fa\u5e94\u7528\u540e\u4ecd\u7136\u5b58\u5728\u3002<\/p>\n<hr \/>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<p>\u8bfb\u53d6\u6162\u4e00\u4e9b\u3002<\/p>\n<hr \/>\n<p>\u6574\u4f53&#xff1a;<\/p>\n<p>\u8bf7\u6c42\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>Memory Cache<\/p>\n<p>\u2193<\/p>\n<p>Disk Cache<\/p>\n<p>\u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<hr \/>\n<h2>\u516d\u5341\u4e03\u3001LRU\u7f13\u5b58\u7b97\u6cd5<\/h2>\n<p>\u5185\u5b58\u6709\u9650\u3002<\/p>\n<p>\u4e0d\u80fd\u65e0\u9650\u4fdd\u5b58\u56fe\u7247\u3002<\/p>\n<p>\u6240\u4ee5\u91c7\u7528&#xff1a;<\/p>\n<p>LRU&#xff1a;<\/p>\n<p>Least Recently Used\u3002<\/p>\n<p>\u610f\u601d&#xff1a;<\/p>\n<p>\u6700\u8fd1\u6700\u5c11\u4f7f\u7528\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7f13\u5b58\u5bb9\u91cf&#xff1a;<\/p>\n<p>100\u5f20\u3002<\/p>\n<p>\u5f53\u524d&#xff1a;<\/p>\n<p>A B C D E<\/p>\n<p>\u7528\u6237\u8bbf\u95ee&#xff1a;<\/p>\n<p>A\u3002<\/p>\n<p>\u53d8\u6210&#xff1a;<\/p>\n<p>B C D E A<\/p>\n<hr \/>\n<p>\u5f53\u52a0\u5165&#xff1a;<\/p>\n<p>F\u3002<\/p>\n<p>\u5220\u9664&#xff1a;<\/p>\n<p>\u6700\u4e45\u672a\u8bbf\u95ee&#xff1a;<\/p>\n<p>B\u3002<\/p>\n<hr \/>\n<p>\u76f8\u518c\u5e94\u7528\u975e\u5e38\u9002\u5408 LRU\u3002<\/p>\n<hr \/>\n<h2>\u516d\u5341\u516b\u3001\u56fe\u7247\u52a0\u8f7d\u7ebf\u7a0b\u6a21\u578b<\/h2>\n<p>\u56fe\u7247\u52a0\u8f7d\u4e0d\u80fd\u963b\u585e UI\u3002<\/p>\n<hr \/>\n<p>\u9519\u8bef&#xff1a;<\/p>\n<p>UI\u7ebf\u7a0b<\/p>\n<p>\u2193<\/p>\n<p>\u8bfb\u53d6\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>\u89e3\u7801<\/p>\n<p>\u2193<\/p>\n<p>\u663e\u793a<\/p>\n<hr \/>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<p>\u9875\u9762\u5361\u987f\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>UI\u7ebf\u7a0b<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>\u4efb\u52a1\u7ebf\u7a0b<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>Image Decode<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>\u8fd4\u56de\u7ed3\u679c<\/p>\n<p>    |<\/p>\n<p>    \u2193<\/p>\n<p>UI\u66f4\u65b0<\/p>\n<hr \/>\n<hr \/>\n<h2>\u516d\u5341\u4e5d\u3001\u5e76\u53d1\u52a0\u8f7d\u63a7\u5236<\/h2>\n<p>\u5f88\u591a\u4eba\u8ba4\u4e3a&#xff1a;<\/p>\n<p>\u7ebf\u7a0b\u8d8a\u591a\u8d8a\u5feb\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a&#xff1a;<\/p>\n<p>\u56fe\u7247\u89e3\u7801\u5c5e\u4e8e CPU \u5bc6\u96c6\u578b\u4efb\u52a1\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u540c\u65f6&#xff1a;<\/p>\n<p>\u542f\u52a8&#xff1a;<\/p>\n<p>50\u4e2a\u56fe\u7247\u89e3\u7801\u3002<\/p>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<p>CPU\u6ee1\u8f7d\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u9650\u5236\u5e76\u53d1\u6570\u91cf\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4efb\u52a1\u961f\u5217<\/p>\n<p>    |<\/p>\n<p>    |<\/p>\n<p>Worker1<\/p>\n<p>Worker2<\/p>\n<p>Worker3<\/p>\n<hr \/>\n<p>\u901a\u5e38&#xff1a;<\/p>\n<p>\u6839\u636e\u8bbe\u5907\u6027\u80fd\u52a8\u6001\u8c03\u6574\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u3001\u5927\u56fe\u7247\u5185\u5b58\u4f18\u5316<\/h2>\n<p>\u56fe\u7247\u5e94\u7528\u6700\u5927\u7684\u95ee\u9898&#xff1a;<\/p>\n<p>\u5c31\u662f\u5185\u5b58\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4e00\u5f20&#xff1a;<\/p>\n<p>6000\u00d74000\u7167\u7247\u3002<\/p>\n<p>RGBA&#xff1a;<\/p>\n<p>\u8ba1\u7b97&#xff1a;<\/p>\n<p>6000 \u00d7 4000 \u00d7 4<\/p>\n<p>\u224896MB<\/p>\n<hr \/>\n<p>\u5982\u679c\u540c\u65f6&#xff1a;<\/p>\n<p>\u52a0\u8f7d5\u5f20&#xff1a;<\/p>\n<p>\u63a5\u8fd1&#xff1a;<\/p>\n<p>500MB\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u5fc5\u987b&#xff1a;<\/p>\n<p>\u63a7\u5236\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u4e00\u3001\u56fe\u7247\u89e3\u7801\u5c3a\u5bf8\u63a7\u5236<\/h2>\n<p>\u4e0d\u8981&#xff1a;<\/p>\n<p>\u9ed8\u8ba4\u52a0\u8f7d\u539f\u56fe\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u67e5\u770b\u9884\u89c8\u3002<\/p>\n<p>\u5c4f\u5e55&#xff1a;<\/p>\n<p>1080P\u3002<\/p>\n<hr \/>\n<p>\u539f\u56fe&#xff1a;<\/p>\n<p>6000\u00d74000\u3002<\/p>\n<p>\u6ca1\u5fc5\u8981\u3002<\/p>\n<hr \/>\n<p>\u5e94\u8be5&#xff1a;<\/p>\n<p>\u6839\u636e\u76ee\u6807\u663e\u793a\u5c3a\u5bf8&#xff1a;<\/p>\n<p>\u8ba1\u7b97\u91c7\u6837\u6bd4\u4f8b\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u76ee\u6807&#xff1a;<\/p>\n<p>1200\u00d7800\u3002<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>\u89e3\u7801&#xff1a;<\/p>\n<p>\u63a5\u8fd1\u8fd9\u4e2a\u5c3a\u5bf8\u5373\u53ef\u3002<\/p>\n<hr \/>\n<p>\u4f18\u52bf&#xff1a;<\/p>\n<p>\u660e\u663e\u964d\u4f4e&#xff1a;<\/p>\n<p>\u5185\u5b58\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u4e8c\u3001\u5feb\u901f\u6ed1\u52a8\u4f18\u5316<\/h2>\n<p>\u76f8\u518c\u5217\u8868&#xff1a;<\/p>\n<p>\u5feb\u901f\u6ed1\u52a8\u65f6&#xff1a;<\/p>\n<p>\u6700\u5bb9\u6613\u5361\u987f\u3002<\/p>\n<hr \/>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>\u5927\u91cf\u56fe\u7247\u8bf7\u6c42\u3002<\/p>\n<hr \/>\n<p>\u4f18\u5316&#xff1a;<\/p>\n<h3>\u7b2c\u4e00<\/h3>\n<p>\u53d6\u6d88\u4e0d\u53ef\u89c1\u4efb\u52a1\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u5feb\u901f\u6ed1\u8fc7&#xff1a;<\/p>\n<p>\u7b2c100\u5f20\u3002<\/p>\n<p>\u8fd8\u6ca1\u52a0\u8f7d\u5b8c\u6210\u3002<\/p>\n<p>\u4f46\u662f\u7528\u6237\u5df2\u7ecf\u5230&#xff1a;<\/p>\n<p>\u7b2c500\u5f20\u3002<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>\u7b2c100\u5f20\u4efb\u52a1\u5e94\u8be5\u53d6\u6d88\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c<\/h3>\n<p>\u63d0\u9ad8\u5f53\u524d\u533a\u57df\u4f18\u5148\u7ea7\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u5f53\u524d\u5c4f\u5e55&#xff1a;<\/p>\n<p>\u4f18\u5148\u52a0\u8f7d\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09<\/h3>\n<p>\u964d\u4f4e\u540e\u53f0\u4efb\u52a1\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u4e09\u3001\u56fe\u7247\u9009\u62e9\u5668\u8bbe\u8ba1<\/h2>\n<p>\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\u670b\u53cb\u5708&#xff1a;<\/p>\n<p>\u9009\u62e9\u56fe\u7247\u3002<\/p>\n<p>\u901a\u5e38&#xff1a;<\/p>\n<p>\u652f\u6301&#xff1a;<\/p>\n<ul>\n<li>\u591a\u9009<\/li>\n<li>\u6570\u91cf\u9650\u5236<\/li>\n<li>\u5df2\u9009\u72b6\u6001<\/li>\n<li>\u539f\u56fe\u9009\u62e9<\/li>\n<\/ul>\n<hr \/>\n<p>\u6570\u636e\u7ed3\u6784&#xff1a;<\/p>\n<p>interface SelectedPhoto {<\/p>\n<p>    asset: PhotoAsset;<\/p>\n<p>    selected:boolean;<\/p>\n<p>    order:number;<\/p>\n<p>}<\/p>\n<hr \/>\n<p>\u4e3a\u4ec0\u4e48\u4fdd\u5b58&#xff1a;<\/p>\n<p>PhotoAsset&#xff1f;<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>\u540e\u7eed\u9700\u8981&#xff1a;<\/p>\n<p>\u83b7\u53d6\u539f\u56fe\u3002<\/p>\n<hr \/>\n<p>\u4e0d\u8981\u4fdd\u5b58&#xff1a;<\/p>\n<p>PixelMap\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u56db\u3001\u591a\u9009\u56fe\u7247\u6027\u80fd\u95ee\u9898<\/h2>\n<p>\u7528\u6237\u9009\u62e9&#xff1a;<\/p>\n<p>50\u5f20\u56fe\u7247\u3002<\/p>\n<p>\u4e0d\u80fd&#xff1a;<\/p>\n<p>\u7acb\u5373\u5168\u90e8\u52a0\u8f7d\u539f\u56fe\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u9009\u62e9\u9636\u6bb5&#xff1a;<\/p>\n<p>\u4fdd\u5b58&#xff1a;<\/p>\n<p>PhotoAsset\u3002<\/p>\n<hr \/>\n<p>\u4e0a\u4f20\u9636\u6bb5&#xff1a;<\/p>\n<p>\u9010\u4e2a\u5904\u7406&#xff1a;<\/p>\n<p>PhotoAsset1<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u538b\u7f29<\/p>\n<p>\u2193<\/p>\n<p>\u4e0a\u4f20<\/p>\n<p>PhotoAsset2<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>\u538b\u7f29<\/p>\n<p>\u2193<\/p>\n<p>\u4e0a\u4f20<\/p>\n<hr \/>\n<p>\u907f\u514d&#xff1a;<\/p>\n<p>\u77ac\u95f4\u5360\u7528\u5927\u91cf\u5185\u5b58\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u4e94\u3001\u7c7b\u4f3c\u5fae\u4fe1\u670b\u53cb\u5708\u56fe\u7247\u9009\u62e9\u5668\u67b6\u6784<\/h2>\n<p>\u4e00\u4e2a\u5b8c\u6574\u56fe\u7247\u9009\u62e9\u5668&#xff1a;<\/p>\n<p>\u5982\u4e0b&#xff1a;<\/p>\n<p>PhotoPickerPage<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>PhotoGrid<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>ThumbnailManager<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>SelectionManager<\/p>\n<p>        |<\/p>\n<p>        \u2193<\/p>\n<p>UploadPipeline<\/p>\n<hr \/>\n<p>SelectionManager&#xff1a;<\/p>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u5df2\u9009\u6570\u91cf<\/li>\n<li>\u6392\u5e8f<\/li>\n<li>\u5220\u9664\u9009\u62e9<\/li>\n<\/ul>\n<hr \/>\n<p>UploadPipeline&#xff1a;<\/p>\n<p>\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u52a0\u8f7d<\/li>\n<li>\u538b\u7f29<\/li>\n<li>\u4e0a\u4f20<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e03\u5341\u516d\u3001\u76f8\u518c\u6a21\u5757\u9519\u8bef\u5904\u7406\u4f53\u7cfb<\/h2>\n<p>\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u5904\u7406\u5f02\u5e38\u3002<\/p>\n<hr \/>\n<h3>\u6743\u9650\u5f02\u5e38<\/h3>\n<p>\u7528\u6237\u62d2\u7edd\u3002<\/p>\n<p>\u5904\u7406&#xff1a;<\/p>\n<p>\u5f15\u5bfc\u6388\u6743\u3002<\/p>\n<hr \/>\n<h3>\u56fe\u7247\u4e0d\u5b58\u5728<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237\u5220\u9664\u3002<\/p>\n<p>\u5904\u7406&#xff1a;<\/p>\n<p>\u5237\u65b0\u5217\u8868\u3002<\/p>\n<hr \/>\n<h3>\u56fe\u7247\u635f\u574f<\/h3>\n<p>ImageSource\u5931\u8d25\u3002<\/p>\n<p>\u5904\u7406&#xff1a;<\/p>\n<p>\u8df3\u8fc7\u3002<\/p>\n<hr \/>\n<h3>\u5185\u5b58\u4e0d\u8db3<\/h3>\n<p>\u964d\u4f4e\u89e3\u7801\u5c3a\u5bf8\u3002<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u4e03\u3001\u76f8\u518c\u751f\u547d\u5468\u671f\u7ba1\u7406<\/h2>\n<p>\u9875\u9762\u9000\u51fa&#xff1a;<\/p>\n<p>\u5fc5\u987b\u91ca\u653e\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>PixelMap\u3002<\/p>\n<p>\u4e0d\u7528\u540e&#xff1a;<\/p>\n<p>\u91ca\u653e\u3002<\/p>\n<hr \/>\n<p>\u7f13\u5b58&#xff1a;<\/p>\n<p>\u6839\u636e\u7b56\u7565\u6e05\u7406\u3002<\/p>\n<hr \/>\n<p>\u540e\u53f0&#xff1a;<\/p>\n<p>\u6682\u505c\u975e\u5fc5\u8981\u4efb\u52a1\u3002<\/p>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u9875\u9762\u8fdb\u5165<\/p>\n<p>\u2193<\/p>\n<p>\u521b\u5efa\u8d44\u6e90<\/p>\n<p>\u2193<\/p>\n<p>\u4f7f\u7528<\/p>\n<p>\u2193<\/p>\n<p>\u9875\u9762\u9000\u51fa<\/p>\n<p>\u2193<\/p>\n<p>\u91ca\u653e<\/p>\n<hr \/>\n<h2>\u4e03\u5341\u516b\u3001\u4f01\u4e1a\u7ea7\u76f8\u518c\u6700\u7ec8\u67b6\u6784<\/h2>\n<p>\u5b8c\u6574&#xff1a;<\/p>\n<p>                Gallery UI<\/p>\n<p>                    |<\/p>\n<p>                    \u2193<\/p>\n<p>              ViewModel<\/p>\n<p>                    |<\/p>\n<p>                    \u2193<\/p>\n<p>             Repository<\/p>\n<p>                    |<\/p>\n<p>                    \u2193<\/p>\n<p>          PhotoAccessService<\/p>\n<p>                    |<\/p>\n<p>                    \u2193<\/p>\n<p>          PhotoAccessHelper<\/p>\n<p>                    |<\/p>\n<p>                    \u2193<\/p>\n<p>             Media Library<\/p>\n<p>\u56fe\u7247\u5904\u7406&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<p>\u2193<\/p>\n<p>ImagePacker<\/p>\n<p>\u2193<\/p>\n<p>\u4fdd\u5b58\/\u4e0a\u4f20<\/p>\n<h3>\u516b\u5341\u3001PhotoAccessHelper \u5e95\u5c42\u539f\u7406\u5206\u6790<\/h3>\n<p>\u524d\u9762\u6211\u4eec\u4e3b\u8981\u7ad9\u5728\u5e94\u7528\u5f00\u53d1\u89d2\u5ea6&#xff0c;\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528 PhotoAccessHelper \u5b8c\u6210&#xff1a;<\/p>\n<ul>\n<li>\u67e5\u8be2\u56fe\u7247<\/li>\n<li>\u5c55\u793a\u76f8\u518c<\/li>\n<li>\u52a0\u8f7d\u7f29\u7565\u56fe<\/li>\n<li>\u83b7\u53d6\u539f\u56fe<\/li>\n<li>\u4fdd\u5b58\u56fe\u7247<\/li>\n<li>\u5220\u9664\u8d44\u6e90<\/li>\n<\/ul>\n<p>\u4f46\u662f\u5982\u679c\u60f3\u771f\u6b63\u638c\u63e1 HarmonyOS NEXT \u76f8\u518c\u4f53\u7cfb&#xff0c;\u8fd8\u9700\u8981\u7406\u89e3\u5b83\u5e95\u5c42\u7684\u5de5\u4f5c\u673a\u5236\u3002<\/p>\n<p>PhotoAccessHelper \u5e76\u4e0d\u662f\u7b80\u5355\u7684\u4e00\u4e2a\u6587\u4ef6\u8bfb\u53d6\u5de5\u5177\u3002<\/p>\n<p>\u5b83\u5b9e\u9645\u4e0a\u8fde\u63a5\u7684\u662f&#xff1a;<\/p>\n<p>\u5e94\u7528\u5c42 \u2192 \u5a92\u4f53\u8bbf\u95ee\u6846\u67b6 \u2192 \u7cfb\u7edf\u5a92\u4f53\u5e93 \u2192 \u6587\u4ef6\u5b58\u50a8\u7cfb\u7edf<\/p>\n<p>\u6574\u4e2a\u94fe\u8def\u3002<\/p>\n<hr \/>\n<h3>\u516b\u5341\u4e00\u3001HarmonyOS \u5a92\u4f53\u8bbf\u95ee\u6574\u4f53\u67b6\u6784<\/h3>\n<p>\u5b8c\u6574\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<p>\u5e94\u7528\u5c42<\/p>\n<p>Gallery App<br \/>\n\u56fe\u7247\u7f16\u8f91\u5668<br \/>\n\u4e0a\u4f20\u7ec4\u4ef6<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>        \u2193<\/p>\n<p>Media Library Framework<\/p>\n<p>        \u2193<\/p>\n<p>DataShare \u6570\u636e\u8bbf\u95ee\u5c42<\/p>\n<p>        \u2193<\/p>\n<p>Media Database<\/p>\n<p>        \u2193<\/p>\n<p>\u6587\u4ef6\u7cfb\u7edf<\/p>\n<p>        \u2193<\/p>\n<p>\u771f\u5b9e\u56fe\u7247\u6587\u4ef6<\/p>\n<hr \/>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>\u5e94\u7528\u5e76\u4e0d\u4f1a\u76f4\u63a5\u64cd\u4f5c\u5e95\u5c42\u6587\u4ef6\u3002<\/p>\n<p>\u6240\u6709\u5a92\u4f53\u8d44\u6e90\u8bbf\u95ee&#xff0c;\u90fd\u7ecf\u8fc7\u7cfb\u7edf\u5a92\u4f53\u670d\u52a1\u3002<\/p>\n<p>\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1&#xff1a;<\/p>\n<ul>\n<li>\u6743\u9650\u63a7\u5236<\/li>\n<li>\u6570\u636e\u4e00\u81f4\u6027<\/li>\n<li>\u5a92\u4f53\u7d22\u5f15\u540c\u6b65<\/li>\n<li>\u5b89\u5168\u9694\u79bb<\/li>\n<\/ul>\n<hr \/>\n<h2>\u516b\u5341\u4e8c\u3001Media Library \u7684\u4f5c\u7528<\/h2>\n<p>HarmonyOS \u7cfb\u7edf\u4e2d&#xff0c;\u7167\u7247\u548c\u89c6\u9891\u5e76\u4e0d\u662f\u7b80\u5355\u5b58\u5728\u4e00\u4e2a\u76ee\u5f55\u4e2d\u3002<\/p>\n<p>\u7cfb\u7edf\u7ef4\u62a4\u4e86\u4e00\u5957\u5a92\u4f53\u6570\u636e\u5e93\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4e00\u5f20\u7167\u7247&#xff1a;<\/p>\n<p>\u6587\u4ef6&#xff1a;<\/p>\n<p>IMG_001.jpg<\/p>\n<p>\u540c\u65f6\u5bf9\u5e94\u6570\u636e\u5e93\u8bb0\u5f55&#xff1a;<\/p>\n<p>{<br \/>\n    uri:&#034;photo:\/\/media\/001&#034;,<\/p>\n<p>    name:&#034;IMG_001.jpg&#034;,<\/p>\n<p>    type:&#034;image\/jpeg&#034;,<\/p>\n<p>    width:4000,<\/p>\n<p>    height:3000,<\/p>\n<p>    createTime:xxx<br \/>\n}<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u7167\u7247\u5b9e\u9645\u4e0a\u6709\u4e24\u4e2a\u90e8\u5206&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u90e8\u5206&#xff1a;<\/p>\n<p>\u5a92\u4f53\u6570\u636e\u3002<\/p>\n<p>\u4e5f\u5c31\u662f&#xff1a;<\/p>\n<p>JPEG \u6587\u4ef6\u3002<\/p>\n<p>\u7b2c\u4e8c\u90e8\u5206&#xff1a;<\/p>\n<p>\u5a92\u4f53\u7d22\u5f15\u3002<\/p>\n<p>\u4e5f\u5c31\u662f&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93\u8bb0\u5f55\u3002<\/p>\n<hr \/>\n<p>\u5173\u7cfb&#xff1a;<\/p>\n<p>        Media Database<\/p>\n<p>              |<\/p>\n<p>              |<\/p>\n<p>        PhotoAsset<\/p>\n<p>              |<\/p>\n<p>              |<\/p>\n<p>        Image File<\/p>\n<hr \/>\n<h2>\u516b\u5341\u4e09\u3001\u4e3a\u4ec0\u4e48 PhotoAsset \u4e0d\u662f\u666e\u901a\u5bf9\u8c61&#xff1f;<\/h2>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u7b2c\u4e00\u6b21\u4f7f\u7528&#xff1a;<\/p>\n<p>PhotoAsset\u3002<\/p>\n<p>\u4f1a\u8ba4\u4e3a&#xff1a;<\/p>\n<p>\u5b83\u5c31\u662f&#xff1a;<\/p>\n<p>\u56fe\u7247\u5bf9\u8c61\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\u4e0d\u662f\u3002<\/p>\n<hr \/>\n<p>PhotoAsset \u66f4\u50cf&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93 Entity\u3002<\/p>\n<p>\u7c7b\u4f3c&#xff1a;<\/p>\n<p>Java \u4e2d&#xff1a;<\/p>\n<p>class UserEntity {<\/p>\n<p>    id;<\/p>\n<p>    name;<\/p>\n<p>}<\/p>\n<hr \/>\n<p>PhotoAsset&#xff1a;<\/p>\n<p>\u4ee3\u8868&#xff1a;<\/p>\n<p>\u5a92\u4f53\u5e93\u4e2d\u7684\u4e00\u6761\u8bb0\u5f55\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>id:<\/p>\n<p>123456<\/p>\n<p>uri:<\/p>\n<p>photo:\/\/media\/123456<\/p>\n<p>name:<\/p>\n<p>test.jpg<\/p>\n<hr \/>\n<p>\u5b83\u672c\u8eab\u4e0d\u5305\u542b&#xff1a;<\/p>\n<p>\u5b8c\u6574\u56fe\u7247\u4e8c\u8fdb\u5236\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u4ee5\u4e0b\u64cd\u4f5c\u662f\u4e0d\u5408\u7406\u7684&#xff1a;<\/p>\n<p>\u4fdd\u5b58\u5927\u91cfPhotoAsset\u5bf9\u8c61<\/p>\n<p>\u2193<\/p>\n<p>\u6c38\u4e45\u7f13\u5b58<\/p>\n<hr \/>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>\u5b83\u53ea\u662f\u5a92\u4f53\u8d44\u6e90\u5f15\u7528\u3002<\/p>\n<hr \/>\n<h2>\u516b\u5341\u56db\u3001PhotoAsset \u751f\u547d\u5468\u671f<\/h2>\n<p>PhotoAsset \u751f\u547d\u5468\u671f&#xff1a;<\/p>\n<p>\u901a\u5e38\u5206\u4e3a\u51e0\u4e2a\u9636\u6bb5\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e00\u9636\u6bb5&#xff1a;\u67e5\u8be2\u4ea7\u751f<\/h3>\n<p>\u5e94\u7528\u67e5\u8be2&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>\u2193<\/p>\n<p>PhotoAsset<\/p>\n<hr \/>\n<p>\u6b64\u65f6&#xff1a;<\/p>\n<p>\u5bf9\u8c61\u53ea\u662f&#xff1a;<\/p>\n<p>\u8d44\u6e90\u63cf\u8ff0\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c\u9636\u6bb5&#xff1a;\u4f7f\u7528<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u83b7\u53d6&#xff1a;<\/p>\n<ul>\n<li>\u540d\u79f0<\/li>\n<li>URI<\/li>\n<li>\u65f6\u95f4<\/li>\n<\/ul>\n<hr \/>\n<h3>\u7b2c\u4e09\u9636\u6bb5&#xff1a;\u8bbf\u95ee\u6570\u636e<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u6253\u5f00\u56fe\u7247\u3002<\/p>\n<p>\u8fdb\u5165&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>ImageSource<\/p>\n<p>\u2193<\/p>\n<p>PixelMap<\/p>\n<hr \/>\n<h3>\u7b2c\u56db\u9636\u6bb5&#xff1a;\u91ca\u653e<\/h3>\n<p>\u9875\u9762\u5173\u95ed\u3002<\/p>\n<p>\u91ca\u653e&#xff1a;<\/p>\n<p>\u76f8\u5173\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<h2>\u516b\u5341\u4e94\u3001URI \u673a\u5236\u6df1\u5165\u7406\u89e3<\/h2>\n<p>HarmonyOS \u4f7f\u7528 URI \u6807\u8bc6\u5a92\u4f53\u8d44\u6e90\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>photo:\/\/media\/xxxxxxxx<\/p>\n<hr \/>\n<p>URI \u7684\u610f\u4e49&#xff1a;<\/p>\n<p>\u4e0d\u662f\u544a\u8bc9\u4f60&#xff1a;<\/p>\n<p>\u6587\u4ef6\u5728\u54ea\u91cc\u3002<\/p>\n<p>\u800c\u662f\u544a\u8bc9\u7cfb\u7edf&#xff1a;<\/p>\n<p>\u6211\u8981\u8bbf\u95ee\u54ea\u4e2a\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<p>\u7c7b\u4f3c&#xff1a;<\/p>\n<p>\u4e92\u8054\u7f51&#xff1a;<\/p>\n<p>https:\/\/example.com\/user\/10086<\/p>\n<p>\u4e0d\u662f\u544a\u8bc9\u6d4f\u89c8\u5668&#xff1a;<\/p>\n<p>\u670d\u52a1\u5668\u6587\u4ef6\u8def\u5f84\u3002<\/p>\n<p>\u800c\u662f&#xff1a;<\/p>\n<p>\u8d44\u6e90\u5b9a\u4f4d\u3002<\/p>\n<hr \/>\n<p>\u5a92\u4f53 URI&#xff1a;<\/p>\n<p>\u4e5f\u662f\u540c\u6837\u601d\u60f3\u3002<\/p>\n<hr \/>\n<h2>\u516b\u5341\u516d\u3001URI \u76f8\u6bd4\u6587\u4ef6\u8def\u5f84\u7684\u4f18\u52bf<\/h2>\n<h3>1. \u6587\u4ef6\u4f4d\u7f6e\u53ef\u4ee5\u53d8\u5316<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u5347\u7ea7\u3002<\/p>\n<p>\u5b58\u50a8\u7b56\u7565\u6539\u53d8\u3002<\/p>\n<hr \/>\n<p>\u4f46\u662f&#xff1a;<\/p>\n<p>URI \u53ef\u4ee5\u4fdd\u6301\u7a33\u5b9a\u3002<\/p>\n<hr \/>\n<h3>2. \u6743\u9650\u63a7\u5236<\/h3>\n<p>\u7cfb\u7edf\u53ef\u4ee5\u5224\u65ad&#xff1a;<\/p>\n<p>\u5f53\u524d\u5e94\u7528\u662f\u5426\u6709\u6743\u8bbf\u95ee\u3002<\/p>\n<hr \/>\n<h3>3. \u8d44\u6e90\u7edf\u4e00\u7ba1\u7406<\/h3>\n<p>\u56fe\u7247&#xff1a;<\/p>\n<p>\u89c6\u9891&#xff1a;<\/p>\n<p>\u97f3\u9891&#xff1a;<\/p>\n<p>\u7edf\u4e00\u4f7f\u7528\u8d44\u6e90\u6a21\u578b\u3002<\/p>\n<hr \/>\n<h2>\u516b\u5341\u4e03\u3001PhotoAccessHelper \u67e5\u8be2\u5230\u5e95\u53d1\u751f\u4e86\u4ec0\u4e48&#xff1f;<\/h2>\n<p>\u8c03\u7528&#xff1a;<\/p>\n<p>helper.getAssets()<\/p>\n<p>\u8868\u9762&#xff1a;<\/p>\n<p>\u53ea\u662f\u4e00\u4e2a\u65b9\u6cd5\u3002<\/p>\n<p>\u5185\u90e8&#xff1a;<\/p>\n<p>\u5927\u6982\u6d41\u7a0b&#xff1a;<\/p>\n<p>\u5e94\u7528<\/p>\n<p>\u2193<\/p>\n<p>IPC\u8c03\u7528<\/p>\n<p>\u2193<\/p>\n<p>\u5a92\u4f53\u670d\u52a1<\/p>\n<p>\u2193<\/p>\n<p>\u6570\u636e\u5e93\u67e5\u8be2<\/p>\n<p>\u2193<\/p>\n<p>\u751f\u6210Asset\u5bf9\u8c61<\/p>\n<p>\u2193<\/p>\n<p>\u8fd4\u56de\u5e94\u7528<\/p>\n<hr \/>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff1a;<\/p>\n<p>\u5b83\u4e0d\u662f\u76f4\u63a5\u8bbf\u95ee\u6570\u636e\u5e93\u3002<\/p>\n<p>\u800c\u662f&#xff1a;<\/p>\n<p>\u8de8\u8fdb\u7a0b\u8bbf\u95ee\u7cfb\u7edf\u670d\u52a1\u3002<\/p>\n<hr \/>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<p>\u9700\u8981\u8003\u8651&#xff1a;<\/p>\n<p>\u5f02\u6b65\u3002<\/p>\n<hr \/>\n<h2>\u516b\u5341\u516b\u3001\u4e3a\u4ec0\u4e48\u76f8\u518c\u67e5\u8be2\u5fc5\u987b\u5f02\u6b65&#xff1f;<\/h2>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>\u67e5\u8be2\u8fc7\u7a0b\u53ef\u80fd\u6d89\u53ca&#xff1a;<\/p>\n<ul>\n<li>IPC\u901a\u4fe1<\/li>\n<li>\u6570\u636e\u5e93\u8bbf\u95ee<\/li>\n<li>\u6743\u9650\u68c0\u67e5<\/li>\n<li>\u5bf9\u8c61\u521b\u5efa<\/li>\n<\/ul>\n<hr \/>\n<p>\u5982\u679c\u540c\u6b65\u6267\u884c&#xff1a;<\/p>\n<p>\u53ef\u80fd\u963b\u585e UI\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u73b0\u4ee3\u7cfb\u7edf API&#xff1a;<\/p>\n<p>\u57fa\u672c\u90fd\u662f&#xff1a;<\/p>\n<p>Promise \/ Async\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>const assets &#061;<br \/>\n    await helper.getAssets(options);<\/p>\n<hr \/>\n<h2>\u516b\u5341\u4e5d\u3001PhotoAsset \u4e0e\u6743\u9650\u5173\u7cfb<\/h2>\n<p>\u4e00\u4e2a\u91cd\u8981\u95ee\u9898&#xff1a;<\/p>\n<p>\u4e3a\u4ec0\u4e48\u67e5\u8be2\u540e\u62ff\u5230 PhotoAsset&#xff1f;<\/p>\n<p>\u4f46\u662f\u6253\u5f00\u5931\u8d25&#xff1f;<\/p>\n<hr \/>\n<p>\u539f\u56e0&#xff1a;<\/p>\n<p>\u6743\u9650\u53ef\u80fd\u53d8\u5316\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<li>\u7528\u6237\u6388\u6743<\/li>\n<li>\u67e5\u8be2\u56fe\u7247<\/li>\n<li>\u7528\u6237\u5173\u95ed\u6743\u9650<\/li>\n<li>\u518d\u8bbf\u95ee\u56fe\u7247<\/li>\n<hr \/>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<p>\u8bbf\u95ee\u5931\u8d25\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u6743\u9650\u4e0d\u662f\u4e00\u6b21\u6027\u7684\u3002<\/p>\n<p>\u4f01\u4e1a\u5e94\u7528\u9700\u8981&#xff1a;<\/p>\n<p>\u6bcf\u6b21\u5173\u952e\u64cd\u4f5c\u68c0\u67e5\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u3001\u5a92\u4f53\u5e93\u53d8\u5316\u76d1\u542c<\/h2>\n<p>\u771f\u5b9e\u76f8\u518c\u5e94\u7528&#xff1a;<\/p>\n<p>\u4e0d\u80fd\u53ea\u67e5\u8be2\u4e00\u6b21\u3002<\/p>\n<p>\u56e0\u4e3a&#xff1a;<\/p>\n<p>\u7cfb\u7edf\u7167\u7247\u968f\u65f6\u53d8\u5316\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7528\u6237&#xff1a;<\/p>\n<ul>\n<li>\u62cd\u7167<\/li>\n<li>\u5220\u9664<\/li>\n<li>\u4e0b\u8f7d\u56fe\u7247<\/li>\n<li>\u63a5\u6536\u804a\u5929\u56fe\u7247<\/li>\n<\/ul>\n<p>\u5a92\u4f53\u5e93\u90fd\u4f1a\u53d8\u5316\u3002<\/p>\n<hr \/>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<p>\u76f8\u518c\u5e94\u7528\u9700\u8981&#xff1a;<\/p>\n<p>\u540c\u6b65\u673a\u5236\u3002<\/p>\n<hr \/>\n<p>\u5178\u578b&#xff1a;<\/p>\n<p>\u6253\u5f00\u9875\u9762<\/p>\n<p>\u2193<\/p>\n<p>\u67e5\u8be2\u5f53\u524d\u6570\u636e<\/p>\n<p>\u2193<\/p>\n<p>\u76d1\u542c\u53d8\u5316<\/p>\n<p>\u2193<\/p>\n<p>\u66f4\u65b0\u5217\u8868<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u9700\u8981\u5a92\u4f53\u53d8\u5316\u901a\u77e5&#xff1f;<\/h2>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>\u76f8\u518c\u9875\u9762\u6253\u5f00\u3002<\/p>\n<p>\u5f53\u524d&#xff1a;<\/p>\n<p>100\u5f20\u7167\u7247\u3002<\/p>\n<p>\u7528\u6237\u9000\u51fa\u3002<\/p>\n<p>\u4f7f\u7528\u7cfb\u7edf\u76f8\u673a\u62cd\u4e86\u4e00\u5f20\u3002<\/p>\n<p>\u8fd4\u56de\u5e94\u7528\u3002<\/p>\n<hr \/>\n<p>\u5982\u679c\u6ca1\u6709\u66f4\u65b0&#xff1a;<\/p>\n<p>\u9875\u9762\u8fd8\u662f&#xff1a;<\/p>\n<p>100\u5f20\u3002<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u5e94\u8be5&#xff1a;<\/p>\n<p>\u81ea\u52a8\u51fa\u73b0&#xff1a;<\/p>\n<p>\u65b0\u7167\u7247\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u4e8c\u3001\u76f8\u518c\u589e\u91cf\u66f4\u65b0\u8bbe\u8ba1<\/h2>\n<p>\u5927\u578b\u5e94\u7528&#xff1a;<\/p>\n<p>\u4e0d\u4f1a\u6bcf\u6b21\u91cd\u65b0\u67e5\u8be2\u5168\u90e8\u3002<\/p>\n<hr \/>\n<p>\u9519\u8bef&#xff1a;<\/p>\n<p>\u65b0\u589e\u4e00\u5f20\u7167\u7247<\/p>\n<p>\u2193<\/p>\n<p>\u91cd\u65b0\u67e5\u8be210000\u5f20<\/p>\n<hr \/>\n<p>\u6b63\u786e&#xff1a;<\/p>\n<p>\u589e\u91cf\u66f4\u65b0\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u6536\u5230&#xff1a;<\/p>\n<p>\u65b0\u589e\u4e8b\u4ef6\u3002<\/p>\n<p>\u53ea\u63d2\u5165&#xff1a;<\/p>\n<p>\u65b0 PhotoAsset\u3002<\/p>\n<hr \/>\n<p>\u6570\u636e&#xff1a;<\/p>\n<p>\u4e4b\u524d&#xff1a;<\/p>\n<p>photo1<\/p>\n<p>photo2<\/p>\n<p>\u65b0\u589e&#xff1a;<\/p>\n<p>photo3<\/p>\n<p>\u66f4\u65b0&#xff1a;<\/p>\n<p>photo3<\/p>\n<p>photo1<\/p>\n<p>photo2<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u4e09\u3001\u76f8\u518c\u6392\u5e8f\u7a33\u5b9a\u6027<\/h2>\n<p>\u5206\u9875\u67e5\u8be2\u4e2d&#xff1a;<\/p>\n<p>\u6392\u5e8f\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u9875&#xff1a;<\/p>\n<p>\u6700\u65b050\u5f20\u3002<\/p>\n<p>\u7528\u6237\u52a0\u8f7d\u7b2c\u4e8c\u9875\u3002<\/p>\n<p>\u671f\u95f4&#xff1a;<\/p>\n<p>\u65b0\u589e\u7167\u7247\u3002<\/p>\n<hr \/>\n<p>\u5982\u679c\u6392\u5e8f\u4e0d\u7a33\u5b9a&#xff1a;<\/p>\n<p>\u53ef\u80fd\u51fa\u73b0&#xff1a;<\/p>\n<p>\u91cd\u590d\u3002<\/p>\n<p>\u6216\u8005&#xff1a;<\/p>\n<p>\u9057\u6f0f\u3002<\/p>\n<hr \/>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>\u901a\u5e38\u9700\u8981&#xff1a;<\/p>\n<p>\u7a33\u5b9a\u6392\u5e8f\u5b57\u6bb5\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u65f6\u95f4 &#043; ID\u3002<\/p>\n<hr \/>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>createTime DESC<\/p>\n<p>id DESC<\/p>\n<hr \/>\n<p>\u4fdd\u8bc1\u5206\u9875\u4e00\u81f4\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u56db\u3001\u76f8\u518c\u641c\u7d22\u529f\u80fd\u8bbe\u8ba1<\/h2>\n<p>\u5927\u578b\u76f8\u518c\u901a\u5e38\u652f\u6301&#xff1a;<\/p>\n<p>\u641c\u7d22\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u641c\u7d22&#xff1a;<\/p>\n<p>\u201c\u751f\u65e5\u201d<\/p>\n<p>\u201c\u65c5\u884c\u201d<\/p>\n<p>\u201c\u622a\u56fe\u201d<\/p>\n<hr \/>\n<p>\u5b9e\u73b0\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u53ef\u80fd\u4f9d\u8d56&#xff1a;<\/p>\n<ul>\n<li>\u6587\u4ef6\u540d<\/li>\n<li>\u65f6\u95f4<\/li>\n<li>\u6807\u7b7e<\/li>\n<li>AI\u8bc6\u522b<\/li>\n<\/ul>\n<hr \/>\n<p>PhotoAccessHelper \u4e3b\u8981\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u5a92\u4f53\u8bbf\u95ee\u3002<\/p>\n<p>\u667a\u80fd\u641c\u7d22&#xff1a;<\/p>\n<p>\u901a\u5e38\u5728\u4e0a\u5c42\u5b9e\u73b0\u3002<\/p>\n<hr \/>\n<p>\u67b6\u6784&#xff1a;<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAsset<\/p>\n<p>        \u2193<\/p>\n<p>Search Engine<\/p>\n<p>        \u2193<\/p>\n<p>\u641c\u7d22\u7ed3\u679c<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u4e94\u3001\u76f8\u518c\u4e0e AI \u56fe\u7247\u5206\u6790\u7ed3\u5408<\/h2>\n<p>HarmonyOS NEXT \u65f6\u4ee3&#xff1a;<\/p>\n<p>\u56fe\u7247\u5e94\u7528\u8d8a\u6765\u8d8a\u667a\u80fd\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u81ea\u52a8\u5206\u7c7b&#xff1a;<\/p>\n<ul>\n<li>\u4eba\u7269<\/li>\n<li>\u98ce\u666f<\/li>\n<li>\u98df\u7269<\/li>\n<li>\u6587\u6863<\/li>\n<\/ul>\n<hr \/>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>\u2193<\/p>\n<p>\u8bfb\u53d6\u56fe\u7247<\/p>\n<p>\u2193<\/p>\n<p>AI\u6a21\u578b\u5206\u6790<\/p>\n<p>\u2193<\/p>\n<p>\u751f\u6210\u6807\u7b7e<\/p>\n<p>\u2193<\/p>\n<p>\u5efa\u7acb\u7d22\u5f15<\/p>\n<hr \/>\n<p>\u6ce8\u610f&#xff1a;<\/p>\n<p>AI\u5206\u6790\u901a\u5e38\u4e0d\u5e94\u8be5\u5f71\u54cd&#xff1a;<\/p>\n<p>\u57fa\u7840\u76f8\u518c\u52a0\u8f7d\u3002<\/p>\n<p>\u5e94\u8be5&#xff1a;<\/p>\n<p>\u540e\u53f0\u6267\u884c\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u516d\u3001PhotoAccessHelper \u6027\u80fd\u4f18\u5316\u539f\u5219<\/h2>\n<p>\u603b\u7ed3\u6838\u5fc3&#xff1a;<\/p>\n<h3>\u7b2c\u4e00<\/h3>\n<p>\u4e0d\u8981\u6279\u91cf\u52a0\u8f7d\u539f\u56fe\u3002<\/p>\n<p>\u5217\u8868\u6c38\u8fdc\u4f7f\u7528\u7f29\u7565\u56fe\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c<\/h3>\n<p>\u4e0d\u8981\u4e00\u6b21\u67e5\u8be2\u5168\u90e8\u8d44\u6e90\u3002<\/p>\n<p>\u4f7f\u7528\u5206\u9875\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09<\/h3>\n<p>\u4e0d\u8981\u957f\u671f\u4fdd\u5b58\u5927\u91cf PhotoAsset\u3002<\/p>\n<p>\u4fdd\u6301\u8f7b\u91cf\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u56db<\/h3>\n<p>\u4e0d\u8981\u963b\u585e UI\u3002<\/p>\n<p>\u6240\u6709\u8bfb\u53d6\u5f02\u6b65\u5316\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e94<\/h3>\n<p>\u505a\u597d\u7f13\u5b58\u3002<\/p>\n<p>\u51cf\u5c11\u91cd\u590d\u89e3\u7801\u3002<\/p>\n<hr \/>\n<h2>\u4e5d\u5341\u4e03\u3001\u5b8c\u6574\u76f8\u518c\u6570\u636e\u6d41\u603b\u7ed3<\/h2>\n<p>\u6700\u7ec8\u5b8c\u6574\u94fe\u8def&#xff1a;<\/p>\n<p>\u7528\u6237\u6253\u5f00\u76f8\u518c<\/p>\n<p>        \u2193<\/p>\n<p>Gallery UI<\/p>\n<p>        \u2193<\/p>\n<p>ViewModel<\/p>\n<p>        \u2193<\/p>\n<p>Repository<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAccessHelper<\/p>\n<p>        \u2193<\/p>\n<p>Media Library<\/p>\n<p>        \u2193<\/p>\n<p>PhotoAsset<\/p>\n<p>        \u2193<\/p>\n<p>Thumbnail<\/p>\n<p>        \u2193<\/p>\n<p>Image\u7ec4\u4ef6\u5c55\u793a<\/p>\n<p>\u70b9\u51fb\u56fe\u7247&#xff1a;<\/p>\n<p>PhotoAsset<\/p>\n<p>        \u2193<\/p>\n<p>ImageSource<\/p>\n<p>        \u2193<\/p>\n<p>PixelMap<\/p>\n<p>        \u2193<\/p>\n<p>\u7f16\u8f91\u5904\u7406<\/p>\n<p>        \u2193<\/p>\n<p>ImagePacker<\/p>\n<p>        \u2193<\/p>\n<p>\u4fdd\u5b58<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001HarmonyOS NEXT \u76f8\u518c\u5f00\u53d1\u4f53\u7cfb\u6982\u8ff0\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d&#xff0c;\u76f8\u518c\u80fd\u529b\u51e0\u4e4e\u662f\u6240\u6709\u56fe\u7247\u7c7b\u5e94\u7528\u7684\u57fa\u7840\u80fd\u529b\u3002\u65e0\u8bba\u662f&#xff1a;\u793e\u4ea4\u5e94\u7528\u4e0a\u4f20\u5934\u50cf\u7535\u5546\u5e94\u7528\u4e0a\u4f20\u5546\u54c1\u56fe\u7247\u56fe\u7247\u7f16\u8f91\u5668\u9009\u62e9\u7d20\u6750\u4e91\u76f8\u518c\u540c\u6b65\u7167\u7247\u77ed\u89c6\u9891\u5e94\u7528\u9009\u62e9\u89c6\u9891\u626b\u63cf\u5e94\u7528\u8bfb\u53d6\u56fe\u7247\u90fd\u9700\u8981\u8bbf\u95ee\u7cfb\u7edf\u5a92\u4f53\u8d44\u6e90\u3002\u5728\u4f20\u7edf\u79fb\u52a8\u5e73\u53f0\u4e2d&#xff0c;\u5f00\u53d1\u8005\u7ecf\u5e38\u901a\u8fc7\u6587\u4ef6\u8def\u5f84\u8bbf\u95ee\u56fe\u7247&#xff0c;\u4f8b\u5982&#xff1a;\/storage\/emulated\/0\/DCIM\/Camera\/photo.jpg\u7136\u540e\u901a\u8fc7\u6587\u4ef6 API \u8bfb\u53d6\u56fe\u7247<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[280,67],"topic":[],"class_list":["post-89443","post","type-post","status-publish","format-standard","hentry","category-server","tag-harmonyos","tag-67"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/89443.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001HarmonyOS NEXT \u76f8\u518c\u5f00\u53d1\u4f53\u7cfb\u6982\u8ff0\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d&#xff0c;\u76f8\u518c\u80fd\u529b\u51e0\u4e4e\u662f\u6240\u6709\u56fe\u7247\u7c7b\u5e94\u7528\u7684\u57fa\u7840\u80fd\u529b\u3002\u65e0\u8bba\u662f&#xff1a;\u793e\u4ea4\u5e94\u7528\u4e0a\u4f20\u5934\u50cf\u7535\u5546\u5e94\u7528\u4e0a\u4f20\u5546\u54c1\u56fe\u7247\u56fe\u7247\u7f16\u8f91\u5668\u9009\u62e9\u7d20\u6750\u4e91\u76f8\u518c\u540c\u6b65\u7167\u7247\u77ed\u89c6\u9891\u5e94\u7528\u9009\u62e9\u89c6\u9891\u626b\u63cf\u5e94\u7528\u8bfb\u53d6\u56fe\u7247\u90fd\u9700\u8981\u8bbf\u95ee\u7cfb\u7edf\u5a92\u4f53\u8d44\u6e90\u3002\u5728\u4f20\u7edf\u79fb\u52a8\u5e73\u53f0\u4e2d&#xff0c;\u5f00\u53d1\u8005\u7ecf\u5e38\u901a\u8fc7\u6587\u4ef6\u8def\u5f84\u8bbf\u95ee\u56fe\u7247&#xff0c;\u4f8b\u5982&#xff1a;\/storage\/emulated\/0\/DCIM\/Camera\/photo.jpg\u7136\u540e\u901a\u8fc7\u6587\u4ef6 API \u8bfb\u53d6\u56fe\u7247\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/89443.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-02T18:56:30+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89443.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/89443.html\",\"name\":\"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-02T18:56:30+00:00\",\"dateModified\":\"2026-08-02T18:56:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/89443.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/89443.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89443.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/89443.html","og_locale":"zh_CN","og_type":"article","og_title":"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001HarmonyOS NEXT \u76f8\u518c\u5f00\u53d1\u4f53\u7cfb\u6982\u8ff0\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d&#xff0c;\u76f8\u518c\u80fd\u529b\u51e0\u4e4e\u662f\u6240\u6709\u56fe\u7247\u7c7b\u5e94\u7528\u7684\u57fa\u7840\u80fd\u529b\u3002\u65e0\u8bba\u662f&#xff1a;\u793e\u4ea4\u5e94\u7528\u4e0a\u4f20\u5934\u50cf\u7535\u5546\u5e94\u7528\u4e0a\u4f20\u5546\u54c1\u56fe\u7247\u56fe\u7247\u7f16\u8f91\u5668\u9009\u62e9\u7d20\u6750\u4e91\u76f8\u518c\u540c\u6b65\u7167\u7247\u77ed\u89c6\u9891\u5e94\u7528\u9009\u62e9\u89c6\u9891\u626b\u63cf\u5e94\u7528\u8bfb\u53d6\u56fe\u7247\u90fd\u9700\u8981\u8bbf\u95ee\u7cfb\u7edf\u5a92\u4f53\u8d44\u6e90\u3002\u5728\u4f20\u7edf\u79fb\u52a8\u5e73\u53f0\u4e2d&#xff0c;\u5f00\u53d1\u8005\u7ecf\u5e38\u901a\u8fc7\u6587\u4ef6\u8def\u5f84\u8bbf\u95ee\u56fe\u7247&#xff0c;\u4f8b\u5982&#xff1a;\/storage\/emulated\/0\/DCIM\/Camera\/photo.jpg\u7136\u540e\u901a\u8fc7\u6587\u4ef6 API \u8bfb\u53d6\u56fe\u7247","og_url":"https:\/\/www.wsisp.com\/helps\/89443.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-02T18:56:30+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"12 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/89443.html","url":"https:\/\/www.wsisp.com\/helps\/89443.html","name":"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-02T18:56:30+00:00","dateModified":"2026-08-02T18:56:30+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/89443.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/89443.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/89443.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"HarmonyOS PhotoAccessHelper \u76f8\u518c\u5f00\u53d1\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=89443"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89443\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=89443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=89443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=89443"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=89443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}