Skip to content

Instantly share code, notes, and snippets.

@rozek
Created January 9, 2020 06:31
Show Gist options
  • Save rozek/7eec8d2d406b22802b4fd0c7235e6da9 to your computer and use it in GitHub Desktop.
Save rozek/7eec8d2d406b22802b4fd0c7235e6da9 to your computer and use it in GitHub Desktop.
Bangle.js: draws a 1bpp bitmap from Espruino Image Converter output
Bangle.setLCDMode('80x80');
g.clear();
const Width = g.getWidth(), CenterX = Width/2;
const Height = g.getHeight(), CenterY = Height/2;
let Image = {
width: 16, height: 16, bpp: 1, transparent: 0,
buffer: E.toArrayBuffer(atob("gAFAAifkCBATyCQkKZQqVCpUKZQkJBPICBAn5EACgAE="))
};
g.drawImage(Image,CenterX-Image.width/2,CenterY-Image.height/2);
g.flip();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment