Skip to content

Instantly share code, notes, and snippets.

@rozek
Created January 14, 2020 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rozek/30fd9863b6b133105a934f87d01e73f8 to your computer and use it in GitHub Desktop.
Save rozek/30fd9863b6b133105a934f87d01e73f8 to your computer and use it in GitHub Desktop.
Bangle.js: draws a previously transferred LenaImg file
const Storage = require('Storage');
Bangle.setLCDMode();
g.clear();
let ImageFile = Storage.open('LenaImg','r');
for (let y = 0; y < 240; y++) {
let LineData = ImageFile.readLine();
g.drawImage({
width:240, height:1, bpp:16, transparent:0,
buffer:E.toArrayBuffer(atob(LineData))
}, 0,y);
}
g.flip();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment