Skip to content

Instantly share code, notes, and snippets.

@rozek
Created January 9, 2020 06:17
Show Gist options
  • Save rozek/b0ce786cedbc4fc1ede86bade385e29f to your computer and use it in GitHub Desktop.
Save rozek/b0ce786cedbc4fc1ede86bade385e29f to your computer and use it in GitHub Desktop.
Bangle.js: creates a bitmap from its binary representation
Bangle.setLCDMode();
g.clear();
const Width = g.getWidth(), CenterX = Width/2;
const Height = g.getHeight(), CenterY = Height/2;
let Image = {
width: 8, height: 8, bpp: 1, transparent: 0,
buffer: new Uint8Array([
0b00000000,
0b00011000,
0b00011000,
0b01111110,
0b01111110,
0b00011000,
0b00011000,
0b00000000,
]).buffer
};
g.drawImage(Image,CenterX-4,CenterY-4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment