# SetDeviceCameraToImage

## Description

Using an image ID greater than zero will stream the device camera to the chosen image. The image must not currently exist, it will be created by this command. Use an imageID of 0 to stop streaming, this will also delete the image.
The cameraID parameter is used when the device has multiple cameras, for example front and back facing cameras. Typically 0 refers the back facing camera. Use GetNumDeviceCameras to see how many cameras this device has and GetDeviceCameraType to check whether it is front or back facing. This parameter is ignored if the imageID is 0.
You can only have one device camera active at once, so to switch from back to front facing cameras you must first call this command with imageID set to 0 to stop the capture, then start it again with the new cameraID.
Returns 1 if it was successful, 0 if there was a problem or the current platform doesn't support this command. This is currently supported on iOS, Android 4.0.3 and above, and Windows.

## Definition

integer SetDeviceCameraToImage( cameraID, imageID )

int agk::SetDeviceCameraToImage( UINT cameraID, UINT imageID )

## Parameters

- cameraID - The ID of the device camera you want to use, could be back or front facing camera
- imageID - The imageID you want to use for this image, must not exist