jgauchia / IceNav-v3

ESP32 Based GPS Navigator with OSM offline maps. (Under development)
GNU General Public License v3.0
50 stars 11 forks source link

how to change the size of arrow navigation #110

Closed zhjygit closed 1 month ago

zhjygit commented 2 months ago

static const unsigned char navigation[] PROGMEM = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x35,0x03,0x36,0x03,0x36,0x03,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x56,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x55,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x76,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x02,0xf7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0xef,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x16,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x57,0x03,0xb9,0x03,0xb9,0x03,0x57,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x36,0x03,0x57,0x03,0x78,0x03,0x78,0x03,0x78,0x03,0x78,0x03,0x57,0x03,0x36,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x03,0x36,0x03,0x36,0x03,0x57,0x03,0x37,0x03,0x57,0x03,0x57,0x03,0x37,0x03,0x56,0x03,0x56,0x03,0x37,0x03,0x36,0x03,0x36,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x03,0x15,0x03,0x36,0x02,0xb5,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xb5,0x03,0x36,0x03,0x15,0x00,0x00,0x00,0x00 ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

};

sprArrow.createSprite(16, 16); sprArrow.setColorDepth(16); sprArrow.pushImage(0, 0, 16, 16, (uint16_t *)navigation);

Now the arrow size is little small, i want to change the arrow bigger on the lcd display. However,when i change the width and height from 16 to 20、25、32 ,it will be not right on the lcd display,distortion. maybe, i should redefine the navigation(static const unsigned char navigation[] PROGMEM =). how can i define the navigation, which tools or url can be accessed? what are the relation between navigation 、colordepth、width and height,why is the size of 'char navigation' 526?

jgauchia commented 1 month ago

Hi, With this link you can convert any PNG file to C array.

https://notisrac.github.io/FileToCArray/

With this settings:

imagen

You need to change sprite size too.