Taking photos
There are many occasions when 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 photo from camera action. The following steps take you through building a demo based on that action:
- Create a new blank multi-device FireMonkey application. Save the main form’s unit as
uFormCam
and the project asCamApp
, and change theName
property of the form toFormCam
. - Change the Style setting in the combobox above the form to iOS or Android.
- Drop a
TImage
component on the form, rename it toImagePhoto
, and align it toClient
. - Add a
TToolBar
component and drop aTSpeedbutton
onto theToolBar1
control. Change itsName
toSpdbtnTakePhoto
and the button’sStylelookup
property tocameratoolbutton
, align it toLeft
, and adjust the width so it becomes a square. - Drop a
TActionList
component...