Comments (5)
Is it possible to draw everything in a frame buffer and then paint the screen at once?
What is a frame buffer?
Do you mean all Pixel data?
If you want to partially rewrite the text on the screen, write the same text in the same color as the background and it will disappear.
uint16_t color;
lcdFillScreen(dev, BLACK);
uint8_t ascii[20];
color = RED;
strcpy((char *)ascii, "Direction=0");
lcdDrawString(dev, fx, 0, 60, ascii, color);
.
.
.
.
color = BLACK;
strcpy((char *)ascii, "Direction=0");
lcdDrawString(dev, fx, 0, 60, ascii, color); // text is disappear.
from esp-idf-st7789.
Do you mean all Pixel data?
Kind of. My goal is to have:
Frame 1 -> Frame 2
| text A | | text B |
But what is possible is:
(draw text) (draw clearing rect) (draw text)
Frame 1 -> Frame 2 -> Frame 3
| text A | | | | text B |
If you want to partially rewrite the text on the screen, write the same text in the same color as the background and it will disappear.
Thanks for the example, but unfortunately it wont solve the problem. The frame inbetween the text draw calls has to be a black rectangle (or black text) to clear the previous text. So there is always one frame before new text can appear.
If one could write all pixel data in a buffer[screen_x][screen_y] and swap all pixel in one draw call, a refresh frame to clear old data wont be necessary, because one can clear and draw on the buffer and flush at once to the screen so no intermediate frame would be visible.
from esp-idf-st7789.
If one could write all pixel data in a buffer[screen_x][screen_y] and swap all pixel in one draw call,
There is lcdDrawMultiPixels().
You will draw RED square.
uint16_t PixelData[16][16];
for (int x=0;x<16;x++);
for (int y=0;y<16;y++);
PixelData[x][y] = RED;
}
}
for (int y=0;y<16,y++) {
lcdDrawMultiPixels(&dev, 0, y, 16, PixelData[[0][y]);
}
The generator for text bitmaps is GetFontx().
from esp-idf-st7789.
The lcdDrawMultiPixels
solves my problem. Thanks!
I scrolled through your code and found an even simpler solution.
Line 772 in 42705cd
from esp-idf-st7789.
This is done if _font_fill is valid:
Line 751 in 42705cd
from esp-idf-st7789.
Related Issues (20)
- TFT backlight not powered on for Lilygo TTGO T-Watch-2020 HOT 4
- Please add a LICENSE to this repository HOT 1
- IMAGE HOT 4
- Just use u lib
- IMAGE HOT 14
- PlatformIO IDE use
- Video playing HOT 2
- Improve performance with frame buffer and DMA HOT 28
- Can not auto reset on my board HOT 24
- No demo appears on screen HOT 3
- This Project can not work on esp32C3 HOT 6
- did you original this st7789 library? HOT 2
- SVG logging HOT 1
- How to display 1 bit depth BMP image? HOT 34
- Not working in ESP-IDF5.0 HOT 5
- Slow Refresh Rate of ST7789 Screen Compared to ESP-IDF Screen Library HOT 5
- demo worked, but only 240x240? HOT 1
- SPI data is sampled on rising edge of clock, wrong mode? HOT 1
- Variable 'size' overflows in function lcdDrawFinish() when setting the resolution to 320*240 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-idf-st7789.