From dc63b215cd015afa87e66a123066417a82aee5d2 Mon Sep 17 00:00:00 2001 From: thirdr Date: Tue, 26 Mar 2024 12:35:40 +0000 Subject: [PATCH] pngdec example for inky --- .../examples/inky_frame/display_png.py | 32 ++++++++++++++++++ micropython/examples/inky_frame/success.png | Bin 0 -> 1063 bytes 2 files changed, 32 insertions(+) create mode 100644 micropython/examples/inky_frame/display_png.py create mode 100644 micropython/examples/inky_frame/success.png diff --git a/micropython/examples/inky_frame/display_png.py b/micropython/examples/inky_frame/display_png.py new file mode 100644 index 00000000..5dec9a3f --- /dev/null +++ b/micropython/examples/inky_frame/display_png.py @@ -0,0 +1,32 @@ +from picographics import PicoGraphics, DISPLAY_INKY_FRAME as DISPLAY # 5.7" +# from picographics import PicoGraphics, DISPLAY_INKY_FRAME_4 as DISPLAY # 4.0" +# from picographics import PicoGraphics, DISPLAY_INKY_FRAME_7 as DISPLAY # 7.3" +import pngdec + +# Create a PicoGraphics instance +graphics = PicoGraphics(DISPLAY) + +# Set the font +graphics.set_font("bitmap8") + +# Create an instance of the PNG Decoder +png = pngdec.PNG(graphics) + +# Clear the screen +graphics.set_pen(1) +graphics.clear() +graphics.set_pen(0) + +# Few lines of text. +graphics.text("Display PNG Image...", 10, 40, 300, 3) +graphics.text("Success!", 10, 70, 300, 3) + +# Open our PNG File from flash. In this example we're using a green check mark. +# You can use Thonny to transfer PNG Images to your Inky Frame. +png.open_file("success.png") + +# Decode our PNG file and set the X and Y +png.decode(130, 70) + +# Start the screen update +graphics.update() diff --git a/micropython/examples/inky_frame/success.png b/micropython/examples/inky_frame/success.png new file mode 100644 index 0000000000000000000000000000000000000000..1ef6561b148301a6c32d8d7da17f7ccb1aab44a2 GIT binary patch literal 1063 zcmV+?1laqDP)EX>4Tx04R}tkv&MmKpe$iTcuJe4t9|0kfAzR6cusQDionYs1;guFuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|?BJy6A|?JWDYS_3;J6>}?mh0_0scmXsb<$WplX(p zP9}tGZdC}rB7i7D7{r*wOnpuiQ}7&L_we!cF3z*O&;2=imAuISpFljzbi*RvAfDc| zbk6(45mu5E;&b9rgDyz?$aUG}H_kbWYY7*5n`d(!Ey()lA#h$5yuo&qkMnX zWrgz=XSGset$XqphV$CWGS_JiA&EsSL4*JqHIz|-g*dGmDJIgipYZTU9luB}nOtQs zax9<<6_Voz|AXJ%nuW;;Hz}L|x?gPjV;BhT0?oQ@e;?a+^8^Sy16NwxUu^(0pQP8@ zTI>ku+XgPK+nT%wTbr*4*A&`#607GSpS-1~@nb zMv9cZ?(y!P&ffk#)9UXBj(T#kH-SA600006VoOIv0RI600RN!9r;`8x010qNS#tmY z4c7nw4c7reD4Tcy000McNliru=mQ!G92Lm=!UO;S0whU9K~zY`-Bm$o6HyR-v$nf- zmA1x0NUc^=1tE~42|cbC?@bgB#iK^g)zYY^oD69TUOY$+7Nl*kh;F=k5F)7+o8BS_ zF$uMaf~f^Dl3LjDl9n{P-R?GCbWY3vv+w=?=KUGqUk@_d^kgGqwNeX$XqYrU528K* z0P`vfv`kE@+#{-4Pvp040(a`pWoDWH;5Iu16Fv!y@%)A8b87_iR}P$V4#WVuZBvb@ zf+B@M5v_4iXwKRvH~@^f-)uxpZ%~)zSt~_lLa?YrRULsR8xgB(8y|=<(4uh)a*uR& ztMJj?-;mT{wetEZ- zie-ZuAY+u7UeDoXb_S#U7xAF@3Qxbjx9}KvY3s9XTQ(*Y;1Q$zB08*4tfrIG1dy3zjqrz24BEj|E!^{rI^84y&5 hyq3)P