Python binding mode attribute

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.

Update: I’m doing all the other graphic stuff in PIL, then using the Python binding matrix.SetImage to push it to the display. Rather than try to use other functions from what appears to be a binding that needs some work, BDFparser can read a bdf font file and create a bitmap image from it.

So while the original question about setting the mode to RGB hasn’t been answered, hopefully this workaround will be useful to others.