Lazarus
Programming => Graphics and Multimedia => Graphics => Topic started by: rc.1990 on September 27, 2016, 06:10:39 pm
-
I am using Lazarus 1.6.0 and FPC 3.0.0.
How can I zoom in, zoom out and rotate images using a TImage component?
-
I think you should not use TImage, it's only the very basic image component to show image on the form. Also it is very slow and can cause flicker if you update the content frequently.
More info on TImage:
http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/timage.html
http://wiki.freepascal.org/Developing_with_Graphics#Draw_to_a_TImage
A list of 'better' image manipulation options can be found here:
http://wiki.freepascal.org/Developing_with_Graphics#2D_drawing
I recommend you to use BGRABitmap, which has a lot of features, tutorials and better support from the developer in this forum:
http://wiki.freepascal.org/BGRABitmap_tutorial
http://forum.lazarus.freepascal.org/index.php/board,46.0.html
You may interested to see BGRABitmap tutorial #10, it shows how to rotate texture:
http://wiki.freepascal.org/BGRABitmap_tutorial_10
-
Yes, and if you want to rotate an image, you can use a TBGRAVirtualScreen and in the redraw event use PutImageAngle (rotation) or Bitmap.PutImageAffine (any affine transformation, so you can zoom and rotate).