FMX.CameraRoll Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample demonstrates how to use TTakePhotoFromLibraryAction to open the Photo Library on your iOS or Android device, retrieve an image from the library and display it on your FireMonkey form.


You can find the AccessCameraApp sample project at:


The CameraRoll sample shows how to use media library actions to take photos from the local library of your iOS or Android device. The sample uses the TTakePhotoFromLibrary action to open the Photo Library of your device. Then, you can choose a photo from the library in order to be displayed 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.
  2. Select the target platform, iOS and Android supported.
  3. Press F9 or choose Run > Run.
  4. Interact with the sample:
    • Click the library button to open the Photo Library of your device.
    • Select a photo.
    • See the photo displayed in your FireMonkey form.


File in Delphi File in C++ Contains



The project itself.



The main form where the components are located.


CameraRollPCH.h, CameraRoll.cpp

Used to define and implement the sample.



Further information about the sample.


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


When you run the aplication, the sample shows a button at the upper right corner with the stylelookup set to organizetoolbuttonbordered. The TTakePhotoFromLibrary action is attached to this button. If you click the button, the Photo Library opens and allows you to choose a photo. Once the photo has been chosen, the OnDidFinishTaking event assigns the image retrieved from the library to the TImage component in order to be displayed on your FireMonkey form.


See Also