|
Post by devben on Feb 17, 2021 22:13:08 GMT -8
Hello! I would like to know if it is possible to draw images or bitmaps to the screen directly without having to use the internal sd card. I already have a sd card on my teensy 4.1 and want to use it for more than just image data. Maybe I am blind and completely missed this section of the docs, but even being able to draw pixel by pixel would be fine, as far as I know a teensy 4.1 at 600Mhz dual core or even overclocking to 800-1Ghz should be able to run that fine.
The reason for this project is because I don't like how the gameduino can only access image data from the card and don't want to have to use two sd cards in the process of making my device. I guess what I'm trying to say is I want to bypass as much of the special functions like bitmaps and similar as possible as I simply don't need them and want to use this like a normal tft lcd, as it is very cost effective for its pixel count and io requirements.
|
|
|
Post by jamesbowman on Feb 18, 2021 15:10:03 GMT -8
Hi devben,
If your graphics fits in flash memory, then you don't need to use microSD at all. Just embed it in the program code. gd3asset can process your assets either way: as a header file to #include from your code, or as microSD.
Teensy 4.1 (of course) has a lot of flash memory, so the #include method works really well.
|
|
|
Post by jamesbowman on Feb 18, 2021 15:14:16 GMT -8
But if you want to load images from the Teensy sd card, you can do something like:
uint8_t buf[256]; size_t n;
GD.cmd_loadimage(0, 0); <open file> while (<read n bytes from file into buf>) GD.copyram(buf, n); <close file>
"copyram()" feeds the buffer to the EVE; that's all it takes to load a JPG or PNG image.
|
|
|
Post by devben on Feb 19, 2021 11:46:29 GMT -8
Thank you, I'll test it as soon as possible
|
|