Python Forum
align frame inside canvas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
align frame inside canvas
#2
you can change the image size to fit canvas, to do this, you need to calculate the aspect ratio, and use it to get new dimensions.
The math for this is simple:

aspect ratio = orig width / orig height
so new height = new width / aspect ratio
or new width = newHeight * aspect ratio
Reply


Messages In This Thread
align frame inside canvas - by ro_btz - Sep-11-2020, 06:57 AM
RE: align frame inside canvas - by Larz60+ - Sep-11-2020, 04:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Help running a loop inside a tkinter frame Konstantin23 3 1,581 Aug-10-2023, 11:41 AM
Last Post: Konstantin23
  [Tkinter] Align the width of the entrys with the column captions Particledust 0 1,726 Apr-23-2020, 08:32 AM
Last Post: Particledust
  [Tkinter] Label, align imported text from pandas kundrius 2 4,232 Dec-11-2019, 08:26 AM
Last Post: kundrius
  [Tkinter] Scrollbar, Frame and size of Frame Maksim 2 9,023 Sep-30-2019, 07:30 AM
Last Post: Maksim
  [Tkinter] Resizing image inside Canvas (with Canvas' resize) Gupi 2 25,107 Jun-04-2019, 05:05 AM
Last Post: Gupi
  [Tkinter] create and insert a new frame on top of another frame atlass218 4 11,136 Apr-18-2019, 05:36 PM
Last Post: atlass218
  video player inside a frame/panel in python raspberry pi desktop application MATHEWS 1 2,849 Dec-12-2018, 11:42 AM
Last Post: Larz60+
  [Tkinter] Frame in canvas wont fill AceScottie 0 3,101 Nov-06-2018, 02:00 PM
Last Post: AceScottie
  [Tkinter] Treeview automatically adjust it's size when pack inside frame Prince_Bhatia 1 27,871 Jul-25-2018, 03:24 AM
Last Post: Larz60+
  [Tkinter] Frame size only works if frame is empty(Solved) Tuck12173 7 6,472 Jan-29-2018, 10:44 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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