Python API

FrameBuffer

Native framebuffer construction, drawing, text, blitting, scrolling, and file output.

Source snapshot: df47b3926b7c52e7f62eddbbf9dc618d6bbd6b6a.

Native framebuffer construction, drawing, text, blitting, scrolling, and file output.

Every entry below is generated from a public binding table or header declaration and links to its immutable source line.

graphics.FrameBuffer

class FrameBuffer(buffer, width, height, format, stride=None)

A framebuf-compatible native drawing surface backed by a writable buffer.

View the pinned source declaration

graphics.FrameBuffer.from_file

FrameBuffer.from_file(path)

Load a supported image file into a new FrameBuffer.

View the pinned source declaration

graphics.FrameBuffer.fill

FrameBuffer.fill(color)

Fill the target canvas with one color and return the affected Area.

View the pinned source declaration

graphics.FrameBuffer.fill_rect

FrameBuffer.fill_rect(x, y, width, height, color)

Fill a rectangular region and return the clipped affected Area.

View the pinned source declaration

graphics.FrameBuffer.pixel

FrameBuffer.pixel(x, y, color=None)

Read or write one pixel, depending on whether a color is supplied.

View the pinned source declaration

graphics.FrameBuffer.hline

FrameBuffer.hline(x, y, width, color)

Draw a horizontal line.

View the pinned source declaration

graphics.FrameBuffer.vline

FrameBuffer.vline(x, y, height, color)

Draw a vertical line.

View the pinned source declaration

graphics.FrameBuffer.rect

FrameBuffer.rect(x, y, width, height, color, fill=False)

Draw an outlined or filled rectangle.

View the pinned source declaration

graphics.FrameBuffer.round_rect

FrameBuffer.round_rect(x, y, width, height, radius, color, fill=False)

Draw an outlined or filled rounded rectangle.

View the pinned source declaration

graphics.FrameBuffer.circle

FrameBuffer.circle(x, y, radius, color, fill=False)

Draw an outlined or filled circle.

View the pinned source declaration

graphics.FrameBuffer.line

FrameBuffer.line(x1, y1, x2, y2, color)

Draw a line between two points.

View the pinned source declaration

graphics.FrameBuffer.ellipse

FrameBuffer.ellipse(x, y, x_radius, y_radius, color, fill=False, mask=0x0F)

Draw selected quadrants of an outlined or filled ellipse.

View the pinned source declaration

graphics.FrameBuffer.poly

FrameBuffer.poly(x, y, coordinates, color, fill=False)

Draw a polygon from a packed coordinate buffer.

View the pinned source declaration

graphics.FrameBuffer.arc

FrameBuffer.arc(x, y, radius, start_angle, end_angle, color)

Draw a circular arc between two angles.

View the pinned source declaration

graphics.FrameBuffer.triangle

FrameBuffer.triangle(x0, y0, x1, y1, x2, y2, color, fill=False)

Draw an outlined or filled triangle.

View the pinned source declaration

graphics.FrameBuffer.gradient_rect

FrameBuffer.gradient_rect(x, y, width, height, color1, color2=None, vertical=True)

Fill a rectangle with a horizontal or vertical color gradient.

View the pinned source declaration

graphics.FrameBuffer.polygon

FrameBuffer.polygon(points, x, y, color, angle=0, center_x=0, center_y=0)

Draw a translated and optionally rotated sequence of points.

View the pinned source declaration

graphics.FrameBuffer.blit

FrameBuffer.blit(source, x, y, key=-1, palette=None)

Copy another framebuffer onto the target with optional keying and palette lookup.

View the pinned source declaration

graphics.FrameBuffer.blit_rect

FrameBuffer.blit_rect(buffer, x, y, width, height)

Copy a packed RGB565 rectangle onto the target.

View the pinned source declaration

graphics.FrameBuffer.blit_transparent

FrameBuffer.blit_transparent(buffer, x, y, width, height, key)

Copy a packed RGB565 rectangle while skipping the transparent key.

View the pinned source declaration

graphics.FrameBuffer.text

FrameBuffer.text(text, x, y, color=1, scale=1, inverted=False, font_data=None, height=8)

Render bitmap text with selectable height, scale, and inversion.

View the pinned source declaration

graphics.FrameBuffer.text8

FrameBuffer.text8(text, x, y, color=1, scale=1, inverted=False, font_data=None)

Render text with the built-in 8-pixel-high font path.

View the pinned source declaration

graphics.FrameBuffer.text14

FrameBuffer.text14(text, x, y, color=1, scale=1, inverted=False, font_data=None)

Render text with the built-in 14-pixel-high font path.

View the pinned source declaration

graphics.FrameBuffer.text16

FrameBuffer.text16(text, x, y, color=1, scale=1, inverted=False, font_data=None)

Render text with the built-in 16-pixel-high font path.

View the pinned source declaration

graphics.FrameBuffer.scroll

FrameBuffer.scroll(x_step, y_step)

Move framebuffer contents by the requested x and y offsets.

View the pinned source declaration

graphics.FrameBuffer.save

FrameBuffer.save(path='screenshot')

Write the current image or bitmap to a versioned output path.

View the pinned source declaration

graphics.FrameBuffer.width

FrameBuffer.width

Width in pixels.

View the pinned source declaration

graphics.FrameBuffer.height

FrameBuffer.height

Height in pixels.

View the pinned source declaration

graphics.FrameBuffer.buffer

FrameBuffer.buffer

Backing pixel buffer when the object owns or exposes one.

View the pinned source declaration

graphics.FrameBuffer.format

FrameBuffer.format

Framebuffer pixel-format identifier.

View the pinned source declaration

graphics.FrameBuffer.color_depth

FrameBuffer.color_depth

Bits per pixel for the framebuffer format.

View the pinned source declaration