File tree Expand file tree Collapse file tree 1 file changed +1
-26
lines changed
Expand file tree Collapse file tree 1 file changed +1
-26
lines changed Original file line number Diff line number Diff line change 2828
2929import tkinter
3030from io import BytesIO
31- from typing import TYPE_CHECKING , Any , cast
31+ from typing import TYPE_CHECKING , Any
3232
3333from . import Image , ImageFile
3434
@@ -263,28 +263,3 @@ def getimage(photo: PhotoImage) -> Image.Image:
263263 _pyimagingtkcall ("PyImagingPhotoGet" , photo , im .getim ())
264264
265265 return im
266-
267-
268- def _show (image : Image .Image , title : str | None ) -> None :
269- """Helper for the Image.show method."""
270-
271- class UI (tkinter .Label ):
272- def __init__ (self , master : tkinter .Toplevel , im : Image .Image ) -> None :
273- self .image : BitmapImage | PhotoImage
274- if im .mode == "1" :
275- self .image = BitmapImage (im , foreground = "white" , master = master )
276- else :
277- self .image = PhotoImage (im , master = master )
278- if TYPE_CHECKING :
279- image = cast (tkinter ._Image , self .image )
280- else :
281- image = self .image
282- super ().__init__ (master , image = image , bg = "black" , bd = 0 )
283-
284- if not getattr (tkinter , "_default_root" ):
285- msg = "tkinter not initialized"
286- raise OSError (msg )
287- top = tkinter .Toplevel ()
288- if title :
289- top .title (title )
290- UI (top , image ).pack ()
You can’t perform that action at this time.
0 commit comments