4
votes

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!

2
Depending on your needs, quite possibly you'd not use any of these controls. If there are a lot of images, then you really don't want to create one control for each image.David Heffernan
was thinking of just generating multiple TImage at run time into a scroll box, but there may be a component that already does something like this automatically.Programmz
Expect that approach to have poor performance as you scale to large numbers of imagesDavid Heffernan
I will do some tests on about 100-200 images and report back, indeed that was a concern of mine. Still interested in finding out differences between those image components regardlessProgrammz
What research have you done. A question asking "what is the difference between these three things" doesn't really fit here on SO. Falls into the category of "too broad".David Heffernan

2 Answers

2
votes

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

0
votes

Apart from the answer by Tamas, note this from https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.ExtCtrls.TImageViewer

Platform Support

Rotating an image viewer using its RotationAngle and RotationCenter properties is only supported on desktop platforms. Rotating an image viewer on mobile platforms might produce unexpected results.