What's the difference between drawImage and drawString to draw pixels #6409
Replies: 1 comment
-
Posted at 2021-03-08 by @gfwilliams
For drawing pixel by pixel, 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 There's an example of that at https://github.com/espruino/BangleApps/blob/master/apps/geissclk/clock.js Posted at 2021-03-08 by tyronehell Great!! @gfwilliams You just like a beacon in my mist! :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-03-07 by tyronehell
I want to draw bitmap (buffer) data directly with inlineC and noticed that the method Graphics.drawImage() used the setPixel(...) to draw the bitmap (buffer) data at last in jswrap_graphics.c, but the method Graphics.drawString() is called
graphicsFillRect()
andgraphicsFillRectDevice
to draw and returnedreturn gfx->fillRect(gfx, (int)x1, (int)y1, (int)x2, (int)y2, col)
, Why this way? What's the difference between the two and which one is more efficient to draw bitmap data?Beta Was this translation helpful? Give feedback.
All reactions