Skip to content

Add fill method as an efficient method to clear a displayio Bitmap #2688

@kevinjwalters

Description

@kevinjwalters

I've been using a 200x201 size Bitmap in CP 5.0.0. At the moment this can only be manipulated by setting individual pixels. This is taking 2.3 seconds on an Adafruit CLUE to assign 0 (the transparent colour from my pallete) to each pixel.

I thought I'd try assigning a full size zero array.array but I ran out of memory. I then tried a row by row approach using slices and got NotImplementedError: Slices not supported.

I could do with a fill() method (implemented in C) a bit like the neopixel library has, that would let me do an efficient clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions