I’m trying to display some text using the Python binding. Here’s the code:
offscreen_canvas = matrix.CreateFrameCanvas()
font = graphics.Font()
font.LoadFont(“…/rpi-rgb-led-matrix/fonts/7x13.bdf”)
textColor = graphics.Color(255, 255, 0)
my_text = “Hello, world!”
graphics.DrawText(offscreen_canvas, font, 0, 0, textColor, my_text)
matrix.SetImage(offscreen_canvas)
And here’s the error message:
File “/home/howard/atos/python/build_sign”, line 175, in
matrix.SetImage(offscreen_canvas)
File “core.pyx”, line 12, in rgbmatrix.core.Canvas.SetImage
AttributeError: ‘rgbmatrix.core.FrameCanvas’ object has no attribute ‘mode’
I can’t figure out how to set the mode (to ‘RGB’).
One potentially important issue is that my script can’t find samplebase to import SampleBase. But I don’t see anything in samplebase.py about mode.
Any help would be greatly appreciated!
Update: I made a smbolic link to samplebase.py, but the same error message appears.