Recent

Author Topic: Does TImage have scaling for PNGs?  (Read 655 times)

AMJF

  • New Member
  • *
  • Posts: 48
Does TImage have scaling for PNGs?
« on: April 15, 2021, 09:33:54 am »
I'm writing a program that shows PNG thumbnails on the right of a TListBox, but the images are too big and so I'm wondering if there is any basic scaling options to reduce the size, preferably to fit in the confines of the TImage control and not have the image expand out beyond the edges of my TForm?

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Does TImage have scaling for PNGs?
« Reply #1 on: April 15, 2021, 10:53:08 am »
Will the images be inside the Listbox, i.e. at the right of each item? In this case you should owner-draw the items and paint the images  by Listbox.Canvas.StretchDraw.

If the images are outside the Listbox in instances of TImage you should size the TImage components as you need and then put their property Proportional to true - the latter scales the images proportionately to fill the component in an undistorted way.

 

TinyPortal © 2005-2018