Taking photos
On many occasions, it is useful to be able to take a photo from an app. The programming model is very easy, but it is not the TCamera
component that you need to use. In FireMonkey, taking photos is achieved by executing a special "take a photo from a camera" action.
Create a new multi-device FireMonkey blank application. Save the main form's unit as uFormCam
, the project as CamApp
, and change the Name
property of the form to FormCam
. Change the Style
in the combobox above the form to iOS
or Android
. Drop TToolbar
and TImage
components on the form. Rename the image as ImagePhoto
and align it to Client
and drop TSpeedbutton
onto the Toolbar1
. Change its Name
to spdbtnTakePhoto
and the button's Stylelookup
property to cameratoolbutton
; align it to the Left
and adjust the width so it becomes a square. Save all.
Drop the TActionList
component on the form and double-click on it to display the Action List Editor
. Right-click on the editor and select the New Standard Action...
option...