Open ElBertrando opened 4 years ago
In the Python binding, there is also a Fill(red, green, blue)
method on the canvas that you can use.
Using runtext.py as basis, I should be able to access the Fill()
method when the offscreen_canvas = self.matrix.CreateFrameCanvas()
is created. So I should be able to access the method by offscreen_canvas.Fill(R,G,B)
? However I do not see autofill in my IDE so I must be doing something wrong in this situation...
Well, apart from the IDE, did you run the code and see if Python complains ?
Well there we go ! I thought it wasn't accessible.
OK one more question for today -- Is text outline color available -O color of outline
??
Read the C++ code how that outline frame is done: you first need to generate an outline font that is essentially a larger font, one pixel around the original font. Then draw that first in your desired outline color before you draw the regular text.
I am looking at the graphics.pyx code and see that it takes 6 arguments for the python bindings:
def DrawText(core.Canvas c, Font f, int x, int y, Color color, text):
return cppinc.DrawText(c.__getCanvas(), f.__font, x, y, color.__color, text.encode('utf-8')
However the c++ code takes 8 arguments to modify the DrawText method. Do I need to modify this ?
you might need to add the kerning parameter to the Python bindings.
Bbnnkojjj Nudeln uikn, z zu if Gesendet mit BlueMail
Am 28. Juli 2020, 01:28, um 01:28, Bret W notifications@github.com schrieb:
I am looking at the graphics.pyx code and see that it takes 6 arguments for the python bindings:
def DrawText(core.Canvas c, Font f, int x, int y, Color color, text): return cppinc.DrawText(c.__getCanvas(), f.__font, x, y, color.__color, text.encode('utf-8')
However the c++ code takes 8 arguments to modify the DrawText method. Do I need to modify this ?
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/hzeller/rpi-rgb-led-matrix/issues/1106#issuecomment-664689549
I have a fully working project now :) However I am just now revisiting the outline problem as my last task. Just to clarify, I will need to modify the graphics.pyx code to add the kerning parameter -- Just this file ? Also I cannot read the German in Turmburger commented
I have a pretty good working model now. I am trying to access the background color in the DrawText function (from the runtext.py) python example. I know you added
canvas->Fill(bg_color.r, bg_color.g, bg_color.b);
for me when I was running by script, but I don't see a way access it via samplebase.py or fromDrawText()