0

Rotating an Image on a TFT screen
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Rotating an Image on a TFT screen

by samuelreynolds on Wed Aug 08, 2018 5:54 pm

I want to rotate an image I created for my tft 1.44" LCD screen. The picture displays on the screen but is vertically positioned instead of horizontally. The learn page for the tft screen says, "To make new bitmaps, make sure they are less than 128 by 128 pixels and save them in 24-bit BMP format! They must be in 24-bit format, even if they are not 24-bit color as that is the easiest format for the Arduino. You can rotate images using the setRotation() procedure". I was able to create the image, but not sure how to rotate it in the code


In the example code there is this:
void loop() {
// uncomment these lines to draw bitmaps in different locations/rotations!

tft.fillScreen(ST7735_BLACK); // Clear display
for(uint8_t i=0; i<4; i++) // Draw 4 parrots
bmpDraw("parrot.bmp", tft.width() / 4 * i, tft.height() / 4 * i);
delay(1000);
tft.setRotation(tft.getRotation() + 1); // Inc rotation 90 degrees


However I don't know how to modify it
Any help would be great
Thanks
-Sam

samuelreynolds
 
Posts: 10
Joined: Thu Aug 02, 2018 5:27 pm

Re: Rotating an Image on a TFT screen

by adafruit_support_mike on Thu Aug 09, 2018 11:44 pm

You have to call .setRotation() before calling the routine that draws the image.

adafruit_support_mike
 
Posts: 54164
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.