Skip to content

Need help with drawing part of an image. #1792

Answered by 2ant
2ant asked this question in Q&A - General
Discussion options

You must be logged in to vote

Thank you for your fast reply !

The n°1 solution seem the best for me right now. I managed to print all four part of a 32x128 image with it.

The image:

The code with a litlle animation :

#include <TFT_eSPI.h>
#include "sample_images.h"
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite spr2 = TFT_eSprite(&tft);
TFT_eSprite spr3 = TFT_eSprite(&tft);

void setup() {
  tft.init();
  tft.setRotation(0);
  tft.fillScreen(TFT_CYAN);

  spr2.setColorDepth(16);
  spr3.setColorDepth(16);

  spr2.createSprite(128,32);
  spr2.setSwapBytes(true);
  
  spr3.createSprite(32,32);
  spr3.setSwapBytes(true);

  spr2.pushImage(0, 0, 128, 32, (uint16_t *)stars3,TFT_BLACK);
  spr2.pushSprite(0, 0, TFT_WHITE);
  
  spr3.p…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 2ant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants