Merhabalar, tkinter da bir label a image koydum. Daha iyi gözükmesi için fotoğrafın boyutunu ayarlamaya çalışıyorum.Label’a
my_label.config(fontsize=‘50’) veya my_label.config(size=‘50’) kodlarını eklediğimde aşağıdaki hataları alıyorum.
line 1638, in configure
return self._config(‘configure’, cnf, kw)
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option “-size”
label widgeti icin size diye bi parametre yok
@overload
def configure(
self,
cnf: Optional[Dict[str, Any]] = ...,
*,
activebackground: _Color = ...,
activeforeground: _Color = ...,
anchor: _Anchor = ...,
background: _Color = ...,
bd: _ScreenUnits = ...,
bg: _Color = ...,
bitmap: _Bitmap = ...,
border: _ScreenUnits = ...,
borderwidth: _ScreenUnits = ...,
compound: _Compound = ...,
cursor: _Cursor = ...,
disabledforeground: _Color = ...,
fg: _Color = ...,
font: _FontDescription = ...,
foreground: _Color = ...,
height: _ScreenUnits = ...,
highlightbackground: _Color = ...,
highlightcolor: _Color = ...,
highlightthickness: _ScreenUnits = ...,
image: _ImageSpec = ...,
justify: Literal["left", "center", "right"] = ...,
padx: _ScreenUnits = ...,
pady: _ScreenUnits = ...,
relief: _Relief = ...,
state: Literal["normal", "active", "disabled"] = ...,
takefocus: _TakeFocusValue = ...,
text: Union[float, str] = ...,
textvariable: Variable = ...,
underline: int = ...,
width: _ScreenUnits = ...,
wraplength: _ScreenUnits = ...,
fotografi yeniden boyutlandirmayi deneyebilirsiniz
image = Image.open('foto.png')
image = image.resize((450, 350)