i
This is not the latest version of this document; to access the latest version, click here.
Official Content

The CameraAPI is an external object that enables smart device apps to interact with the device's photo camera. The main purpose of this object is to invoke the Camera Native application of the device, take a picture and be able to use that image in the application.

This article has a step by step tutorial to use this feature in a Smart Device application generated by GeneXus Native Mobile Generator.

Step 1: External Object CameraAPI

To interact with the camera, an External Object has to be used: CameraAPI.

CameraAPIExternalObj

TakePhoto: This method invokes the device's camera native application, so the user can take a picture and select it to use it in the application.

Step 2: Learn by Example

a. Create a Panel object:

Layout:

CameraAPILayoutPane

Variables:

&photo -> Image data type

Events:

Event 'TakePhoto'
    &photo = CameraAPI.TakePhoto()
Endevent

Step 3: Execution

Once the action is executed:

CameraAPIios1

After taking a picture:

CameraAPIios2

After using it:

CameraAPIios3





Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant