{"id":226036,"date":"2020-12-16T05:23:28","date_gmt":"2020-12-15T21:23:28","guid":{"rendered":"http:\/\/4563.org\/?p=226036"},"modified":"2020-12-16T05:23:28","modified_gmt":"2020-12-15T21:23:28","slug":"%e5%a4%a7%e4%bd%ac%e4%bb%ac%ef%bc%8c%e8%bf%99%e7%a7%8d%e5%88%87%e5%89%b2%e5%8a%a0%e6%8b%bc%e5%9b%be%e7%9a%84%e5%8a%9f%e8%83%bd%e8%af%a5%e6%80%8e%e4%b9%88%e5%ae%9e%e7%8e%b0%e5%95%8a","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=226036","title":{"rendered":"\u5927\u4f6c\u4eec\uff0c\u8fd9\u79cd\u5207\u5272\u52a0\u62fc\u56fe\u7684\u529f\u80fd\u8be5\u600e\u4e48\u5b9e\u73b0\u554a"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5927\u4f6c\u4eec\uff0c\u8fd9\u79cd\u5207\u5272\u52a0\u62fc\u56fe\u7684\u529f\u80fd\u8be5\u600e\u4e48\u5b9e\u73b0\u554a               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tangshuaibo <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u7c7b\u4f3c\u8fd9\u79cd\uff1a[https:\/\/www.jigsawexplorer.com\/online-jigsaw-puzzle-player.html?puzzle_id=christmas-peace]<\/p>\n<p>\u56fe\u7247\u8be5\u600e\u4e48\u6309\u7167\u62fc\u56fe\u56fe\u5757\u7684\u5f62\u72b6\u5207\u5272\uff1f\u7136\u540e\u4e24\u4e2a\u56fe\u5757\u7ec4\u5408\u540e\u662f\u600e\u4e48\u53d8\u6210\u4e00\u4f53\u7684\uff1f<\/p>\n<p>fabricjs \u80fd\u6ee1\u8db3\u8981\u6c42\u5417\uff1f\u6c42\u63a8\u8350\u4e0b\uff0c\u80fd\u5b9e\u73b0\u8fd9\u7c7b\u9700\u6c42\uff0c\u7b80\u5355\u597d\u7528\u7684 canvas \u5e93\u2026\u2026<\/p>\n<p>\u6211\u53ea\u505a\u8fc7\u4e9b h5 \u5c0f\u7a0b\u5e8f\u8fd9\u7c7b\u7684\uff0c\u5b8c\u5168\u6ca1\u6709 canvas \u7ecf\u9a8c\u2026\u2026<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>12<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4578641\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tangshuaibo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5927\u4f6c\u5927\u4f6c\u6c42\u51fa\u73b0\uff0c\u7ed9\u4e2a\u601d\u8def\u5c31\u597d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578642\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : misdake <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ## \u753b\u6bcf\u4e00\u7247\uff1a<\/p>\n<p>\u53c2\u8003\u94fe\u63a5\uff1a<br \/>https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Canvas_API\/Tutorial\/Compositing<br \/>https:\/\/stackoverflow.com\/a\/18387192\/2244973<\/p>\n<p>\u5982\u679c\u6bcf\u4e00\u7247\u5f62\u72b6\u7684\u6570\u91cf\u662f\u6709\u9650\u7684\uff0c\u6216\u8005\u5f62\u72b6\u662f\u65e0\u89c4\u5f8b\u7684\uff1a<br \/>1. drawImage \u753b mask(\u5373\u63cf\u8ff0\u5f62\u72b6\u7684\u56fe\u7247)<br \/>2. globalCompositeOperation = &#8216;source-in&#8217;; \u8bbe\u7f6e\u4e3a\u53ea\u5141\u8bb8\u753b\u5728 mask \u4e0a<br \/>3. drawImage \u753b\u56fe\u7247\u672c\u4f53<br \/>\u6ce8\u610f\u8c03\u6574\u753b\u56fe\u7684 src \u4f4d\u7f6e\u548c dest \u4f4d\u7f6e<\/p>\n<p>\u5982\u679c\u6bcf\u4e00\u7247\u5f62\u72b6\u7684\u6570\u91cf\u662f\u975e\u5e38\u591a\u4e14\u6709\u89c4\u5f8b\u7684\uff1a<br \/>1. \u753b\u4e00\u4e2a path\uff0c\u4f5c\u4e3a\u5f62\u72b6<br \/>2. context.clip(); \u8bbe\u7f6e\u4e3a\u53ea\u80fd\u5728\u8303\u56f4\u5185\u753b<br \/>3. context.drawImage \u753b\u56fe\u7247\u672c\u4f53<\/p>\n<p>## \u53d8\u6210\u4e00\u4f53<br \/>\u8fd9\u4e2a\u6ca1\u4ec0\u4e48\u7279\u522b\u7684\u5427\uff0c\u5224\u65ad\u7ec4\u5408\u7136\u540e\u4f9d\u6b21\u753b\u4e0a\u53bb\u5c31\u884c\u4e86<br \/>\u5728\u677e\u9f20\u6807\u7684\u65f6\u5019\uff0c\u5224\u65ad\u4e00\u4e0b\u539f\u56fe\u4e2d\u5468\u56f4\u7684\u5757\u662f\u4e0d\u662f\u771f\u7684\u5728\u65c1\u8fb9\uff0c\u5982\u679c\u5728\u5c31\u7528\u5e76\u67e5\u96c6\u8fde\u5728\u4e00\u8d77\u3002\u518d\u62d6\u52a8\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u96c6\u5408\u7684\u5757\u5168\u90e8\u4e00\u8d77\u79fb\u52a8\uff0c\u677e\u5f00\u7684\u65f6\u5019\uff0c\u5168\u90e8\u5224\u65ad\u65b0\u7684\u7ec4\u5408                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578643\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tangshuaibo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @misdake \u597d\u7684\uff0c\u8c22\u8c22\u5927\u4f6c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578644\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jaxer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6210\u529f\u5212\u6c34 17min\uff0c\u5b8c\u6210\u540e\u4e0b\u9762\u7684\u6b22\u547c\u4eba\uff0c\u4ee5\u4e3a\u662f\u4e27\u5c38                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578645\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fengmumu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u60f3\u5230\u7684\u5b9e\u73b0\u7684\u8bdd\u601d\u8def\u5927\u6982\u662f\u8fd9\u6837<br \/>\u6bcf\u4e00\u4e2a\u62fc\u56fe\u90fd\u662f\u7531\u6838\u5fc3\u533a\u57df\u52a0\u56db\u5468\u7684\u62fc\u63a5\u7684\u63a5\u53e3\u7ec4\u6210<br \/>\u7136\u540e\u6211\u628a\u56fe\u7247\u4f7f\u7528 cavas \u5206\u5272\u6210\u591a\u4e2a\u5c0f\u5757\uff0c\u6bcf\u4e2a\u5c0f\u5757\u4e4b\u95f4\u662f\u6709\u4f4d\u7f6e\u5173\u7cfb\u7684\uff0c<br \/>\u7136\u540e\u6211\u662f\u4e0d\u60f3\u7528 canvas \u7684\uff0c\u6211\u662f\u60f3\u7528\u56fe\u7247\u6216\u8005 span \u6765\u505a\uff0c\u6bd5\u7adf\u6709\u56fe\u7247\u4e86\uff0c\u6709\u5173\u7cfb\u4e86\uff0c\u5269\u4e0b\u5c31\u662f\u6e32\u67d3\u4e86<br \/>\u7136\u540e\u662f\u5426\u62fc\u63a5\u7684\u8bdd \u53ea\u9700\u8981\u5224\u65ad \u4e24\u4e2a\u62fc\u56fe\u7684\u4f4d\u7f6e\u5173\u7cfb\u5c31\u884c\u4e86\uff0c<br \/>\u6240\u8c13\u7ec4\u7684\u5173\u7cfb\uff0c\u5176\u5b9e\u4e5f\u5c31\u662f\u79fb\u52a8\u7684\u65f6\u5019\u7edf\u4e00\u79fb\u52a8\uff0c\u7ed9\u6bcf\u4e00\u4e2a\u5143\u7d20\u90fd\u6dfb\u52a0\u5c31\u884c<\/p>\n<p>\u4e0d\u77e5\u9053\u8bf4\u6e05\u695a\u6ca1\u6709\uff0c\u611f\u89c9\u91cd\u70b9\u5728\u56fe\u7247\u7684\u5207\u5206\uff0c\u548c\u662f\u5426\u62fc\u597d\u7684\u5224\u65ad\u8fd9<br \/>\u4f60\u8981\u662f\u8981\u7528 canvs \u53ef\u4ee5\u7528 konva,\u4ed6\u6709\u5e55\u5e03\u548c\u7ec4\u7684\u6982\u5ff5\u3002\u62fc\u597d\u7684\u653e\u5230\u4e00\u4e2a\u7ec4\u5c31\u884c\u4e86\uff0c\u8fd9\u4e2a\u5176\u5b9e\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u505a\u7684<\/p>\n<p>ps: canvas \u60f3\u8981\u73a9\u7684\u597d\uff0c\u7ebf\u6027\u4ee3\u6570\u8dd1\u4e0d\u4e86                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578646\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yzqtdu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u53ef\u4ee5\u770b\u770b\u8fd9\u7bc7\u6587\u7ae0\uff0c\u57fa\u672c\u80fd\u89e3\u51b3\u4f60\u7684\u95ee\u9898<br \/>https:\/\/www.codeproject.com\/Articles\/395453\/Html5-Jigsaw-Puzzle                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578647\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jorneyr <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u56fe\u7247\u90fd\u662f\u77e9\u5f62\u7684\uff0c\u770b\u5230\u4e0d\u89c4\u5219\u7684\u5f62\u72b6\u662f\u56e0\u4e3a\u989c\u8272\u900f\u660e\u7684\u539f\u56e0\u3002<br \/>\u7ed9\u6bcf\u79cd\u56fe\u7247\u4e00\u4e2a\u7c7b\u578b\uff0c\u4e0a\u4e0b\u5de6\u53f3\u80fd\u8854\u63a5\u7684\u56fe\u7247\u7684\u7c7b\u578b\u4e5f\u662f\u56fa\u5b9a\u5339\u914d\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578648\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tangshuaibo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @jaxer \u4ec0\u4e48\u610f\u601d\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578649\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tangshuaibo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @fengmumu \u8c22\u8c22\u5927\u4f6c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578650\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tangshuaibo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yzqtdu \u8c22\u8c22\u5927\u4f6c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578651\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tangshuaibo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @jorneyr \u8c22\u8c22\u5927\u4f6c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4578652\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : M3oM3oBug <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 Canvas \u5b8c\u5168\u53ef\u4ee5\u505a\uff0c\u4e0a\u4e5f\u8bf4\u4e86 konva \u548c\u89e3\u51b3\u601d\u8def\uff0c\u6211\u4e5f\u6709\u4e00\u5957\u81ea\u5df1\u7684\u89e3\u51b3\u65b9\u6848\u6709\u70b9\u7c7b\u4f3c konva \u4e5f\u53ef\u4ee5\u505a\uff0c\u4e0d\u8fc7\u8bdd\u8bf4\u8003\u8651\u5916\u5305\u7ed9\u6211\u5417\u54c8\u54c8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u4f6c\u4eec\uff0c\u8fd9\u79cd\u5207\u5272\u52a0\u62fc\u56fe\u7684\u529f\u80fd\u8be5\u600e\u4e48&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/226036"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=226036"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/226036\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226036"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}