Last active
September 18, 2020 19:37
-
-
Save phoddie/cc3eac687a165dd06ecb8721854bb2d0 to your computer and use it in GitHub Desktop.
Uses Poco clipping too decompress and draw a JPEG image with text superimposed using no extra microcontroller memory needed.
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
let palatino36 = parseBMF(new Resource("palatino_36.fnt")); | |
palatino36.bitmap = parseBMP(new Resource("palatino_36.bmp")); | |
// background | |
poco.begin() | |
poco.fillRectangle(gray, 0, 0, poco.width, poco.height); | |
poco.drawText("Hello Basuke", palatino36, white, 15, 20); | |
poco.end(); | |
// render JPEG blocks with text composed on top | |
let jpeg = new JPEG(new Resource("piano.jpg")); | |
let block; | |
while (block = jpeg.read()) { | |
poco.begin(block.x + 60, block.y, block.width, block.height); | |
poco.drawBitmap(block, block.x + 60, block.y); | |
poco.drawText("Hello Basuke", palatino36, white, 15, 20); | |
poco.end(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment