Skip to main content

Inkplate 6 MicroPython - Drawing Graphics

Inkplate 6 allows you to draw different geometric shapes anywhere on its 800 x 600 px canvas. The shapes can be filled or hollow


Drawing Shapes

Below is a example that demonstrates how to draw basic shapes in Black-White display mode.

ℹ️
If you want to use the grayscale mode, simply change the constructor value and instead of using inkplate.BLACK use a numeric value: 0-3
from inkplate6 import Inkplate
import time

inkplate = Inkplate(Inkplate.INKPLATE_1BIT)
inkplate.begin()
inkplate.clearDisplay()
inkplate.display()

inkplate.drawPixel(100, 100, inkplate.BLACK)
inkplate.drawRect(50, 50, 75, 75, inkplate.BLACK)
inkplate.drawCircle(200, 200, 30, inkplate.BLACK)
inkplate.fillCircle(300, 300, 30, inkplate.BLACK)
inkplate.drawFastHLine(20, 100, 50, inkplate.BLACK)
inkplate.drawFastVLine(100, 20, 50, inkplate.BLACK)
inkplate.drawLine(100, 100, 400, 400, inkplate.BLACK)
inkplate.drawRoundRect(100, 10, 100, 100, 10, inkplate.BLACK)
inkplate.fillRoundRect(10, 100, 100, 100, 10, inkplate.BLACK)
inkplate.drawTriangle(300, 100, 400, 150, 400, 100, inkplate.BLACK)

inkplate.display()

inkplate.drawPixel()

Set a single pixel in the frame buffer.

Function parameters:

TypeNameDescription
NumberxX coordinate.
NumberyY coordinate.
ConstcolorColor constant (BLACK or WHITE in BW mode).

inkplate.drawRect()

Draw an unfilled rectangle outline.

Function parameters:

TypeNameDescription
NumberxLeft X.
NumberyTop Y.
NumberwWidth in pixels.
NumberhHeight in pixels.
ConstcolorOutline color.

inkplate.drawCircle()

Draw an unfilled circle.

Function parameters:

TypeNameDescription
Numberx0Center X.
Numbery0Center Y.
NumberrRadius in pixels.
ConstcolorOutline color.

inkplate.fillCircle()

Draw a filled circle.

Function parameters:

TypeNameDescription
Numberx0Center X.
Numbery0Center Y.
NumberrRadius in pixels.
ConstcolorFill color.

inkplate.drawFastHLine()

Draw a horizontal line quickly.

Function parameters:

TypeNameDescription
NumberxStart X.
NumberyY position.
NumberwLine width in pixels.
ConstcolorLine color.

inkplate.drawFastVLine()

Draw a vertical line quickly.

Function parameters:

TypeNameDescription
NumberxX position.
NumberyStart Y.
NumberhLine height in pixels.
ConstcolorLine color.

inkplate.drawLine()

Draw a line from one point to another.

Function parameters:

TypeNameDescription
Numberx0Start X.
Numbery0Start Y.
Numberx1End X.
Numbery1End Y.
ConstcolorLine color.

inkplate.drawRoundRect()

Draw an unfilled rectangle with rounded corners.

Function parameters:

TypeNameDescription
NumberxLeft X.
NumberyTop Y.
NumberwWidth in pixels.
NumberhHeight in pixels.
NumberradiusCorner radius in pixels.
ConstcolorOutline color.

inkplate.fillRoundRect()

Draw a filled rectangle with rounded corners.

Function parameters:

TypeNameDescription
NumberxLeft X.
NumberyTop Y.
NumberwWidth in pixels.
NumberhHeight in pixels.
NumberradiusCorner radius in pixels.
ConstcolorFill color.

inkplate.drawTriangle()

Draw a triangle outline using three vertices.

Function parameters:

TypeNameDescription
Numberx0Vertex A X.
Numbery0Vertex A Y.
Numberx1Vertex B X.
Numbery1Vertex B Y.
Numberx2Vertex C X.
Numbery2Vertex C Y.
ConstcolorOutline color.
Inkplate 6 running the example code
Simple predefined shapes.