Recent

Author Topic: how can I resize the image contained in a canvas...  (Read 3436 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2257
    • Lazarus and Free Pascal italian community
how can I resize the image contained in a canvas...
« on: March 27, 2012, 08:30:22 am »
how can I resize the image contained in a canvas of say 20%?

of course maintaining the image proportions?!
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: how can I resize the image contained in a canvas...
« Reply #1 on: March 27, 2012, 08:53:10 am »
There is: http://lazarus-ccr.sourceforge.net/docs/lcl/graphics/tcanvas.copyrect.html

I don't know if it works in all widgetsets correctly if the source and destination canvas are the same, you can always create a TBitmap of the destination size and use it's canvas as the destination canvas for the CopyRect operation.

xinyiman

  • Hero Member
  • *****
  • Posts: 2257
    • Lazarus and Free Pascal italian community
Re: how can I resize the image contained in a canvas...
« Reply #2 on: March 27, 2012, 10:40:27 am »
Thank you  :D
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018