i'm building an FMX app for iOS, it has a TImageViewer
on a TPanel
with the TImageViewer
aligned to Contents. I load a bitmap from file into the TImageViewer
and i can then pan around and zoom in/out on the image. Works fine.
What i want now is a button click event to reposition the left edge of the image on the left edge of the TPanel
so it looks like the top image below.
Here is example of what it looks like when first loaded:
Here it is after i have panned it around:
I've searched and experimented all day but i just can't get it. I tried reloading the bitmap file but did nothing. Any suggestions?
thanks, russ
Found a way based on this delphi question. Note that ImageMap is the name of my TImageViewer
on Form1.
TPointF myOffset;
myOffset = Form1->ImageMap->ViewportPosition; // this is (0,0) before the image is panned around, non-zero otherwise
Form1->ImageMap->ScrollBy(myOffset.X, myOffset.Y) ;