Hi,
thanks for rpi-rgb-led-matrix
i’m trying to display an image an text on two 64x64 panels in chain.
i’m using the python bindings.
my problem is, that i cant show both at one time without flickering.
i played with two canvas.
i want to show the image and a clock, so i need update the canvas every second.
def set_image():
image = Image.open(“images/vfb.png”).convert(‘RGB’)
image = image.resize((32, 32), Image.ANTIALIAS)
draw = ImageDraw.Draw(image) # Declare Draw instance before prims
image_canvas.SetImage(image, -8, 16)def uhr(): global offscreen_canvas fake = matrix.CreateFrameCanvas() font = graphics.Font() font.LoadFont("fonts/5x8.bdf") textColor = graphics.Color(196, 196, 196) aktuelleZeit = datetime.now() fake = matrix.CreateFrameCanvas() len1 = graphics.DrawText(fake, font, 0, 0, textColor, aktuelleZeit.strftime('%H:%M:%S')) graphics.DrawText(offscreen_canvas, font, matrix.width - 1 - len1, matrix.height - 1, textColor, aktuelleZeit.strftime('%H:%M:%S' try: print("Press CTRL-C to stop.") set_image() image_canvas = matrix.SwapOnVSync(image_canvas) while True: offscreen_canvas.Clear() uhr() offscreen_canvas = matrix.SwapOnVSync(offscreen_canvas) time.sleep(1) except KeyboardInterrupt: sys.exit(0)
is it possible to show an image and text at the same time?
my i understood the canvas not correct.
Thanks for help.
Greetings Simon