FMX.ImageZoom Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample uses the TGestureManager class to demonstrate how to zoom an image.

Location

You can find the ImageZoom sample project at:

  • Start | Programs | Embarcadero RAD Studio Athens | Samples and then navigate to:
    • Object Pascal\Mobile Snippets\InteractiveGestures\ImageZoom
    • CPP\Mobile Snippets\InteractiveGestures\ImageZoom
  • Subversion Repository:
    • You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Description

The ImageZoom sample demonstrates how to zoom an image on an iOS or Android device. The sample provides a picture and the user can zoom the picture by pinching it.

How to Use the Sample

  1. Navigate to one of the locations given above and open:
    • Delphi: ImageZoom.dproj.
    • C++: ImageZoom.cbproj.
  2. Select the target platform, iOS and Android supported.
  3. Press F9 or choose Run > Run.
  4. Pinch the picture to see how it zooms.

Files

File in Delphi File in C++ Contains

ImageZoom.dproj

ImageZoom.cbproj

The project itself.

ImageZoomU.fmx

ImageZoomU.fmx

The main form where the components are located.

ImageZoomU.pas

ImageZoomPCH.h, ImageZoom.cpp

Used to define and implement the sample.

Information.txt

Information.txt

Further information about the sample.

Implementation

The sample shows a picture. The sample uses the field GestureID of the TGestureEventInfo to identify a zoom gesture. When TGestureEventInfo identifies a zoom gesture, the sample uses the TImage.Position, TImage.Width and TImage.Height properties to zoom the picture.

Uses

See Also

Samples