Skip to content

Latest commit

 

History

History

AccessCameraApp

FMX.AccessCameraApp Sample

FMX.AccessCameraApp Sample

This sample shows you how to use standard actions to open the camera application, take a picture and retrieve the taken image to display it on your FireMonkey form.

Contents

Location

You can find the AccessCameraApp sample project at:

Description

The AccessCameraApp sample shows how to use TTakePhotoFromCameraAction to open the camera application on your iOS or Android device, take a picture and retrieve the taken image to display it on your FireMonkey form.

How to Use the Sample

  1. Navigate to one of the locations given above and open:
  • Delphi: AccessCameraApp.dproj.
  • C++: AccessCamera.cbproj.
  1. Select the target platform, iOS and Android supported.
  2. Press F9 or choose Run > Run.
  3. Interact with the sample. Click the camera button to open the camera window and take a picture.

Files

File in Delphi File in C++ Contains
AccessCameraApp.dproj AccessCamera.cbproj The project itself.
uMain.fmx uMain.fmx The main form where the components are located.
uMain.pas AccessCameraPCH.h, AccessCamera.cpp Used to define and implement the sample.
Information.txt Information.txt Further information about the sample.

Classes

TAccessCameraAppForm is the main form that represents the main window of the sample. It contains the following components:

Implementation

  • The sample uses TTakePhotoFromCameraAction to take photos from the camera device.
  • The sample uses TImage to display and define 2D image components. When you run the aplication, the sample shows a picture and a button with the stylelookup set to cameratoolbuttonbordered. The TTakePhotoFromCameraAction is attached to this button. If you click the button, the camera window is displayed and allows you to choose the camera to be used (front or back) and to take a photo. Once the photo has been taken, the OnDidFinishTaking event assigns the image retrieved from the camera to the TImage component.

Uses

See Also

Samples