Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between TImage, TImageViewer, TImageControl?

Looked in the delphi help and could not find out when one should use each component over the other...

I am wondering what the differences are between these very similar controls: TImage, TImageViewer, and TImageControl.

I am interested in displaying multiple images on a form, to scroll through in a scrollbox; but all three of those components could be used, and I have no idea which one to choose!

like image 905
Programmz Avatar asked Oct 29 '22 22:10

Programmz


1 Answers

Hi, I've just found this answer (from Alexander Brazda), because I wanted to know as well:

"..If you need to display a simple image (without borders, scroll bars, etc) use TImage this like a fmx primitive like any other shape (TRectangle, TCircle, TEllipse, TPipe, ...)

For an image with a control style (border, background, etc) use TImageControl

and for Zoom, Scroll, Dialogs, etc use TImageViewer.

TImage its simplex (just draw a image over a control where its placed), TSyledControls use a collection of objects to draw and copy values from control properties to style objects.

Of course you can use a TRectangle and Fill it with a TBitmap Brush. Image with WrapMode=Original and BitmapMargins empty would call Canvas.DrawBitmap() with any transformation (except screen scale if defined)..."

You can see the post : Google+ Delphi Developers forum

like image 106
Tamas Avatar answered Nov 15 '22 07:11

Tamas