how to resize an image mantaining aspect ratio. lazarus / 39-Graphics ---------------------------------------------------------------------- dcelso · 2013-01-27 11:50 hello to all. I have program to load a image on a timage. The image can be any known format of timage can load. I need put a preview of the image in a 50x50 container so i want resize it maintaining aspect ratio. The result will be a 50x? Image or ?x50 image.  what is the better method to do it.? ---------------------------------------------------------------------- User137 · 2013-01-27 12:50 Use math and logics. You get the relative size by Width/Height. For example 400x200 would give you 2, also that 200x200 image would result 1. So if x>1, then image is horizontally bigger. Same relation number can be used as a multiplier. For example if you draw image horizontally, you can image.width := 50; image.height := 50 / x; ---------------------------------------------------------------------- dcelso · 2013-01-27 13:16 Yes. I know it. But what function and image container can i use in Lazarus? For example Tlazimginterfaz has methods to do it? ---------------------------------------------------------------------- User137 · 2013-01-27 14:30 TPanel and TImage in it for example. TImage has Stretch property which you could use in this case. ---------------------------------------------------------------------- dcelso · 2013-01-27 15:04 , thanx i will try it