ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Camera functions
  • Photos and videos saved
  • Backup directories
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Starts the device's native camera application to record a video or to take a photo.
Remarks:
  • iPhone/iPadIOS Widget Note: Syntax 2 using a non-blocking call is recommended, especially from iOS 8 onwards.
  • In a WINDEV application, CameraCapture can be used to record a video or to take a photo with the camera of the device.
  • This function is equivalent to VideoStartApp.
Example
sPhoto is string
sPhoto = CameraRunApp(viPictureCapture)
IF sPhoto <> "" THEN
	Info("Photo sauvegardée dans le fichier " + sPhoto)
END
nTypeEnregistrement is int
// Laisse l'utilisateur décider du type de capture
IF Dialog("Souhaitez-vous enregistrer une image ou une vidéo ?", ["Une image", ...
	"Une vidéo"], 1, 2, dlgIconQuestion) = 1 THEN
	nTypeEnregistrement = viPictureCapture
ELSE
	nTypeEnregistrement = viVideoCapture
END
// Lance l'application
CameraRunApp(nTypeEnregistrement, CaméraLanceAppli_Callback)

INTERNAL PROCEDURE CaméraLanceAppli_Callback(sChemin is string)
	// Si le retour vaut chaîne vide (""), une erreur a eu lieu
	IF sChemin ~= "" THEN
		Error(ErrorInfo())
		RETURN
	END
	// Message de fin d'enregistrement
	Info("Le fichier a été enregistré ici : " + sChemin)
END
Syntax

Starting the native camera application (locking call) Hide the details

<Result> = CameraRunApp([<Type of capture>])
<Result>: Character string
  • Full path of file where the photo or the video was saved,
  • Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo.
<Type of capture>: Optional integer constant
Type of capture:
viPictureCaptureRecord a photo.
viVideoCapture
(Default value)
Camera preview stream snip.

Starting the native camera application (non-locking call) Hide the details

<Result> = CameraRunApp([<Type of capture> [, <WLanguage procedure>]])
<Result>: Boolean
  • True if the photo or video was saved.
  • False otherwise. To get more details on the error, use ErrorInfo.
<Type of capture>: Optional integer constant
Type of capture:
viPictureCaptureRecord a photo.
viVideoCapture
(Default value)
Camera preview stream snip.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when the photo or video is recorded.
For more details on this procedure, see Parameters of the procedure used by CameraRunApp.
Remarks

Photos and videos saved

The photo and video settings (format, resolution, size) are the ones defined in the native camera application.
To display the photo in an Image control, open the Image control description, go to the "Details" tab and check "Orientate according to the image's Exif data".

Backup directories

AndroidAndroid Widget In Android applications, the photo or video is stored on the SD Card of the device and is automatically added to the album.
If photos must be used in your Android applications, we advise you to work with thumbnails and not with the initial photos taken by the device. To generate the thumbnails, use CameraGenerateThumbnail.
iPhone/iPadIOS Widget In iPhone/iPad applications:
By default:
  • the photos are saved in the "Documents" directory of application.
  • the videos are saved in the "tmp" directory of application.
For the images, you can also:
  • store the binary content of the image in a database, via a Memo item.
  • add the photo to the photo album of the device with AlbumSave. In this case, the image can be re-used via AlbumPicker.
Business / UI classification: UI Code
Component: wd300android.aar
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/25/2025

Send a report | Local help