{"id":371,"date":"2022-12-15T19:06:40","date_gmt":"2022-12-15T11:06:40","guid":{"rendered":"http:\/\/www.huangrongzhen.ink\/?p=371"},"modified":"2022-12-15T19:12:51","modified_gmt":"2022-12-15T11:12:51","slug":"embgui-%e5%ba%93%ef%bc%88%e6%ad%a3%e5%9c%a8%e6%92%b0%e5%86%99%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.huangrongzhen.ink\/?p=371","title":{"rendered":"EmbGUI \u5e93\uff08\u6b63\u5728\u64b0\u5199\uff09"},"content":{"rendered":"<div class=\"wp-block-post-excerpt\"><p class=\"wp-block-post-excerpt__excerpt\">EmbGUI \u9002\u7528\u4e8e\u5355\u7247\u673a\u5e73\u53f0\u505a\u7b80\u5355\u7684\u754c\u9762\u663e\u793a\u3002 <\/p><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AE%80%E4%BB%8B\"><\/span>\u7b80\u4ecb<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>EMWIN \u548c LVGL \u7b49 GUI \u5e93\u867d\u7136\u5177\u6709\u7ec4\u4ef6\u4e30\u5bcc\uff0c\u4fbf\u4e8e\u79fb\u690d\u548c\u5e94\u7528\u7b49\u7279\u70b9\uff0c\u4f46\u6709\u4e00\u4e2a\u4ee4\u4eba\u70e6\u607c\u7684\u8bdf\u75c5\uff0c\u90a3\u5c31\u662f\u5361\u987f\u3002EmbGUI \u5c31\u662f\u4e13\u95e8\u7528\u4e8e\u89e3\u51b3\u5361\u987f\u7684\u95ee\u9898\u3002EmbGUI \u5177\u6709\u6781\u9ad8\u7684\u81ea\u7531\u5ea6\uff0c\u63d0\u4f9b\u4e86Text\u3001\u6309\u94ae\u3001\u7ed8\u66f2\u7ebf\u3001\u884c\u8f93\u5165\u3001\u5355\u9009\u6846\u7b49\u57fa\u672c\u7ec4\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u81ea\u7531\u66f4\u6539\u91cc\u8fb9\u7684\u6e90\u7801\u4ee5\u83b7\u5f97\u6700\u4f73\u7684 GUI \u4f53\u9a8c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%96%87%E4%BB%B6%E5%A4%B9%E4%BB%8B%E7%BB%8D\"><\/span>\u6587\u4ef6\u5939\u4ecb\u7ecd<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>EmbGUI \u6e90\u7801\u6709 4 \u4e2a\u6587\u4ef6\u5939\uff0c\u5206\u522b\u662f \u201dApp\u201c\u3001\u201dModule\u201c\u3001\u201dPlatform\u201c \u548c \u201dWidget\u201c\uff0c\u4e0b\u8fb9\u5206\u522b\u4ecb\u7ecd\u3002<\/p>\n\n\n\n<p>1\u3001App \u6587\u4ef6\u5939\uff1a\u6b64\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653e\u7528\u6237\u5e94\u7528\u4ee3\u7801\uff0c\u6e90\u7801\u53d1\u5e03\u65f6\u4e3a\u7a7a\u3002<\/p>\n\n\n\n<p>2\u3001Module \u6587\u4ef6\u5939\uff1a\u6b64\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653e\u7528\u6237\u5199\u7684 GUI \u7ec4\u4ef6\uff0c\u4f8b\u5982\u7528\u6237\u5199\u4e86\u4e2a\u901a\u7528\u952e\u76d8\u754c\u9762\uff0c\u6b64\u65f6\u53ef\u4ee5\u5c06\u952e\u76d8\u754c\u9762\u76f8\u5173\u4ee3\u7801\u653e\u5230\u6b64\u6587\u4ef6\u5939\u3002<\/p>\n\n\n\n<p>3\u3001Platform \u6587\u4ef6\u5939\uff1a\u6b64\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653e\u79fb\u690d\u76f8\u5173\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>4\u3001Widget \u6587\u4ef6\u5939\uff1a\u7528\u4e8e\u5b58\u653e\u5404\u4e2a\u63a7\u4ef6\u7684\u6e90\u7801\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%A7%BB%E6%A4%8D\"><\/span>\u79fb\u690d<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GUIConfh_%E4%BB%8B%E7%BB%8D\"><\/span>GUIConf.h \u4ecb\u7ecd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>GUIConf.h \u7528\u4e8e\u914d\u7f6e EmbGUI\uff0c\u5305\u62ec\u5c4f\u5e55\u5206\u8fa8\u7387\u3001\u9009\u7528\u7684\u50cf\u7d20\u70b9\u683c\u5f0f\u3001\u652f\u6301\u7684\u5b57\u4f53\u7c7b\u578b\u3001\u652f\u6301\u663e\u793a\u7684\u56fe\u7247\u683c\u5f0f\u7b49\u7b49\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GUIPlatformh_%E4%BB%8B%E7%BB%8D\"><\/span>GUIPlatform.h \u4ecb\u7ecd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>GUIPlatform.h \u5b9a\u4e49\u4e86 EmbGUI \u5e38\u7528\u7684 API \u51fd\u6570\uff0cEmbGUI \u91cc\u6240\u6709\u63a7\u4ef6\u5747\u662f\u91c7\u7528\u8fd9\u4e9b API \u51fd\u6570\u7ed8\u5236\u56fe\u50cf\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GUIPlatformc_%E4%BB%8B%E7%BB%8D\"><\/span>GUIPlatform.c \u4ecb\u7ecd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>GUIPlatform.c \u5373\u4e3a\u5e73\u53f0\u79fb\u690d\u6587\u4ef6\uff0c\u7528\u6237\u9700\u8981\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u52a0\u4ee5\u5b8c\u5584\u3002<\/p>\n\n\n\n<p>1\u3001\u753b\u70b9\u51fd\u6570\u3002EmbGUI \u7684\u753b\u70b9\u51fd\u6570\u8981\u6c42\u8981\u80fd\u7ed8\u5236\u6307\u5b9a\u5927\u5c0f\u7684\u70b9\uff0c\u5982\u4e0b\u6240\u793a\u3002\u4e3a\u4e86\u517c\u5bb9\u8d85\u5927\u5206\u8fa8\u7387\uff0cEmbGUI \u6240\u6709\u7684\u5750\u6807\u53c2\u6570\u5747\u4e3a\u65e0\u7b26\u53f7 32 \u4f4d\u6574\u578b\uff0c\u540c\u65f6\u4e3a\u4e86<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"C++\" class=\"language-C++\">void GUIDrawPoint(u32 x, u32 y, u32 size, u32 color)\r\n{\r\n  int a, b;\r\n  int di;\r\n  int i, p;\r\n  if(0 == size){return;}\r\n  a = 0; b = size;\r\n  di = 3 - (size &lt;&lt; 1);\r\n  while(a &lt;= b)\r\n  {\r\n    i = a, p = b;\r\n    while(i > 0)\r\n    {\r\n      LCDFastDrawPoint(x + b,y - i, color);\r\n      LCDFastDrawPoint(x - i,y + b, color);\r\n      i--;\r\n    }\r\n    while( p > 0)\r\n    {\r\n      LCDFastDrawPoint(x - a, y - p, color);\r\n      LCDFastDrawPoint(x - p, y - a, color);\r\n      LCDFastDrawPoint(x + a, y - p, color);\r\n      LCDFastDrawPoint(x - p, y + a, color);\r\n      LCDFastDrawPoint(x + a, y + p, color);\r\n      LCDFastDrawPoint(x + p, y + a, color);\r\n      p--;\r\n    }\r\n    a++;\r\n\r\n    \/\/Bresenham\u7b97\u6cd5\u753b\u5706\r\n    if(di &lt; 0)\r\n    {\r\n      di += 4 * a + 6;\r\n    }\r\n    else\r\n    {\r\n      di += 10 + 4 * (a - b);\r\n      b--;\r\n    }\r\n  }\r\n  LCDFastDrawPoint(x, y, color); \/\/\u5706\u5fc3\u5750\u6807\r\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%BA%90%E7%A0%81\"><\/span>\u6e90\u7801<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-7a813123-b678-435b-967a-8f1fc4f60008\" href=\"http:\/\/www.huangrongzhen.ink\/wp-content\/uploads\/2022\/12\/EmbGUI-V1.0.0-20221215.rar\">EmbGUI-V1.0.0-20221215<\/a><a href=\"http:\/\/www.huangrongzhen.ink\/wp-content\/uploads\/2022\/12\/EmbGUI-V1.0.0-20221215.rar\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-7a813123-b678-435b-967a-8f1fc4f60008\">\u4e0b\u8f7d<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>EmbGUI \u9002\u7528\u4e8e\u5355\u7247\u673a\u5e73\u53f0\u505a\u7b80\u5355\u7684\u754c\u9762\u663e\u793a\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=\/wp\/v2\/posts\/371"}],"collection":[{"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=371"}],"version-history":[{"count":7,"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions"}],"predecessor-version":[{"id":379,"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions\/379"}],"wp:attachment":[{"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.huangrongzhen.ink\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}