Skip to content

Blit bitbuffer  #11

@TecDroiD

Description

@TecDroiD

Hi,
i try to load a raw image (60x60 pixels, rgb565) using the following code:

from machine import Pin, SPI
from ili934xnew import *
import tt24 as font
from framebuf import *

spi = SPI(1, baudrate=45000000)
d = ILI9341(spi, Pin('X5'), Pin('X4'), Pin('X3'),w=320,h=240,r=2)

bg=color565(100,100,100)
fg=color565(0,0,0)
d.set_color(fg,bg)
d.erase()

with open('prism.raw', 'rb') as fp:
    b = FrameBuffer(bytearray(fp.read()),60,60,framebuf.RGB565)
    d.blit(b, 30,30,120,120)

and get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ili934xnew.py", line 247, in blit
IndexError: bytearray index out of range

is it my fault or some issue in the blit source?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions