• drawString uses graphicsFillRect because bitmap fonts can be 'scaled' - you can have a bitmap font scaled up by 4x in which case each 'pixel' is a 4x4 rect.

    For drawing pixel by pixel, setPixel is the way to go.

    However what device are you using InlineC on? For instance on Bangle.js it can make a lot of sense to have an offscreen buffer and to use Inline C to write direct into that buffer, and then use g.drawImage to draw that to the screen (drawImage has a special fast path for blits)

    There's an example of that at https://github.com/espruino/BangleApps/b­lob/master/apps/geissclk/clock.js

About

Avatar for Gordon @Gordon started