Created
September 26, 2021 11:33
-
-
Save hollyhockberry/000326050e6c184fdf14ee987c31f92f to your computer and use it in GitHub Desktop.
M5Paper: draw bitmap to fixed size with M5GFX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5EPD.h> | |
#include <M5GFX.h> | |
void setup() { | |
M5.begin(); | |
M5GFX display; | |
display.begin(); | |
display.invertDisplay(false); | |
display.clear(TFT_WHITE); | |
float dx, dy; | |
M5Canvas canvas(&display); | |
canvas.setPsram(true); | |
canvas.createFromBmpFile(SD, "/inaba.bmp"); | |
dx = 400.f / static_cast<float>(canvas.width()); | |
dy = 400.f / static_cast<float>(canvas.height()); | |
canvas.pushRotateZoomWithAA(270, 240, 0.f, dx, dy); | |
canvas.createFromBmpFile(SD, "/inaba2.bmp"); | |
dx = 400.f / static_cast<float>(canvas.width()); | |
dy = 400.f / static_cast<float>(canvas.height()); | |
canvas.pushRotateZoomWithAA(270, 720, 0.f, dx, dy); | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment