Python Forum
howto get size of a ctk image?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
howto get size of a ctk image?
#3
(Oct-03-2023, 03:33 AM)deanhystad Wrote: "size". my_image.cget("size") returns the size attribute (width, height) of one of the images. The light and dark images have to be the same size, so it doesn't matter which.

You could also ask for one of the images and then ask it for the size.
image.cget("light_image").size
That is how you know to use "size" as the attribute for cget. PIL.Image.size returns the size of the image. CTkImage.cget("size") returns the size attribute of the light or dark image.
Thank You. I missed the mention in documentation that images are PIL objects at first read.
Reply


Messages In This Thread
howto get size of a ctk image? - by janeik - Oct-03-2023, 02:56 AM
RE: howto get size of a ctk image? - by deanhystad - Oct-03-2023, 03:33 AM
RE: howto get size of a ctk image? - by janeik - Oct-03-2023, 03:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Howto do motion event on solely window and not the widgets on it? janeik 3 948 Jul-11-2023, 12:10 AM
Last Post: deanhystad
  PIL doesn't seem to paste full size image. DreamingInsanity 7 3,494 Nov-21-2019, 07:42 PM
Last Post: DreamingInsanity
  size of set vs size of dict zweb 0 2,209 Oct-11-2019, 01:32 AM
Last Post: zweb
  Is there a way to detect the text font, size and color from an image in python? Maia07 2 8,820 Aug-23-2018, 01:16 PM
Last Post: Maia07
  CSV file created is huge in size. How to reduce the size? pramoddsrb 0 10,574 Apr-26-2018, 12:38 AM
Last Post: pramoddsrb
  Howto try catch consuli 2 3,985 Nov-14-2016, 08:03 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020