<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Drawing an icon on the M5Paper from an array]]></title><description><![CDATA[<p dir="auto">On the M5Paper how can I draw an icon using a function with drawPixel() from an array of the form;</p>
<p dir="auto">static const uint8_t SUNRISE64x64[8192] = {<br />
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff........};</p>
]]></description><link>https://community.m5stack.com/topic/5929/drawing-an-icon-on-the-m5paper-from-an-array</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 06:47:50 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5929.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 30 Dec 2023 16:57:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Drawing an icon on the M5Paper from an array on Sun, 31 Dec 2023 10:32:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/steve1" aria-label="Profile: Steve1">@<bdi>Steve1</bdi></a></p>
<p dir="auto">I had success with the following <a href="https://notisrac.github.io/FileToCArray/" target="_blank" rel="noopener noreferrer nofollow ugc">converter</a> settings.</p>
<p dir="auto"><img src="/assets/uploads/files/1704017737690-iconconvert1_20231231.png" alt="0_1704017737289_IconConvert1_20231231.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1704017750557-iconconvert2_20231231.png" alt="0_1704017750382_IconConvert2_20231231.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This creates a array size of 8192 - same as the stock icons and displays correctly using the <code>DrawIcon()</code> function from the Weather app.</p>
<pre><code>// array size is 8192
static const uint16_t IconCloud64x64[]  = {
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
</code></pre>
<p dir="auto">Note: I had best results converting jpg using above converter. (png did not work for me and always created an all zero array.)</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/23189</link><guid isPermaLink="true">https://community.m5stack.com/post/23189</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sun, 31 Dec 2023 10:32:14 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing an icon on the M5Paper from an array on Sun, 31 Dec 2023 08:47:30 GMT]]></title><description><![CDATA[<p dir="auto">Yes indeed, that's the very code I'm using at the moment. The problem is the people over at the Arduino Forum insist that the code is "not allowed" and bad C/C++ coding because the icon arrays are uint8_t and the DrawIcon function uses uint16_t. Here is a <a href="https://forum.arduino.cc/t/using-a-pointer-in-a-struct/1204736/25" target="_blank" rel="noopener noreferrer nofollow ugc">link to the discussions</a> this issue appears towards the end of the discussion from post 20/38. Also it is very difficult for me to understand eactly how the DrawIcon function works, even though it most certainly does work. I have tried changing the uint16_t references in the function to uint8_t and the arrays to uint16_t but all I get with both changes is a black square instead of an icon.</p>
]]></description><link>https://community.m5stack.com/post/23187</link><guid isPermaLink="true">https://community.m5stack.com/post/23187</guid><dc:creator><![CDATA[Steve1]]></dc:creator><pubDate>Sun, 31 Dec 2023 08:47:30 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing an icon on the M5Paper from an array on Sat, 30 Dec 2023 19:13:17 GMT]]></title><description><![CDATA[<p dir="auto">There is an M5Paper weather display that uses that very code.  Maybe looking at it will help you figure it out.  I am just getting started coding, but I compiled that weather project yesterday and remember seeing that code.</p>
<p dir="auto"><a href="https://github.com/Bastelschlumpf/M5PaperWeather/blob/master/weather/Icons.h" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/Bastelschlumpf/M5PaperWeather/blob/master/weather/Icons.h</a></p>
]]></description><link>https://community.m5stack.com/post/23185</link><guid isPermaLink="true">https://community.m5stack.com/post/23185</guid><dc:creator><![CDATA[Meldrak]]></dc:creator><pubDate>Sat, 30 Dec 2023 19:13:17 GMT</pubDate></item></channel></rss>