Created
January 9, 2020 06:17
-
-
Save rozek/b0ce786cedbc4fc1ede86bade385e29f to your computer and use it in GitHub Desktop.
Bangle.js: creates a bitmap from its binary representation
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
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