add number_circle

This commit is contained in:
2025-10-14 13:59:42 +02:00
parent 98794a36ed
commit f62b790472
10 changed files with 182 additions and 46 deletions

View File

@@ -1,9 +1,12 @@
from PIL import Image, ImageDraw
from .base import View
class NumberView(View):
def _init_canvas(self):
self.label = self.canvas.create_text(50, 68, text="0.0 g", font=("Arial", 18), fill='black', justify='left')
def update_weight(self, weight):
self.canvas.itemconfig(self.label, text=f"{weight:.1f} g")
im = self.bkg_im.copy()
im_draw = ImageDraw.Draw(im)
im_draw.text((50, 68), f"{weight:.1f} g",
fill='black', font_size=24)
return im