<?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[M5Paper icon displaying as 2 small icons.]]></title><description><![CDATA[<p dir="auto">I am using an M5Paper and I have created a static const int8_t array using this <a href="https://notisrac.github.io/FileToCArray/" target="_blank" rel="noopener noreferrer nofollow ugc">website</a>.</p>
<p dir="auto">I then use the command</p>
<p dir="auto">"DrawIcon(100, 780, (uint16_t *)Arrow_circle_down, 64, 64, true);"</p>
<p dir="auto">together with the same drawIcon command for my other icons which are in an icon.h file I downloaded from the internet. All of the other icons display correctly but the icon I created displays as two small icons at the top and part of an unconnected icon at the bottom of the 64x64 square.</p>
<p dir="auto">My working icon arrays look like this:<br />
<em>static const uint8_t SUNRISE64x64[8192] = {<br />
0xff, 0xff, 0xff,........};</em></p>
<p dir="auto">My created icon array array looks like this;<br />
<em>// array size is 4096<br />
static const int8_t Arrow_circle_down[]  = {<br />
0xff, 0xff, 0xff,........};</em></p>
<p dir="auto">I tried putting the array size 4096 in the square brackets but that made no difference.</p>
<p dir="auto">The function drawIcon is:</p>
<p dir="auto"><em>void DrawIcon(int x, int y, const uint16_t <em>icon, int dx /</em>= 64</em>/, int dy /<em>= 64</em>/, bool highContrast /<em>= false</em>/) {<br />
for (int yi = 0; yi &lt; dy; yi++) {<br />
for (int xi = 0; xi &lt; dx; xi++) {<br />
uint16_t pixel = icon[yi * dx + xi];<br />
if (highContrast) {<br />
if (15 - (pixel / 4096) &gt; 0) canvas.drawPixel(x + xi, y + yi, M5EPD_Canvas::G15);<br />
} else {<br />
canvas.drawPixel(x + xi, y + yi, 15 - (pixel / 4096));<br />
}<br />
}<br />
}<br />
}*</p>
<p dir="auto">Why is the created icon not displaying correctly?</p>
]]></description><link>https://community.m5stack.com/topic/5887/m5paper-icon-displaying-as-2-small-icons</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 12:37:33 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/5887.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Dec 2023 09:54:21 GMT</pubDate><ttl>60</ttl></channel></rss>