ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Camera functions
  • Photos and videos saved
  • Backup directories
  • Required application feature
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Starts the device's native camera application to record a video or to take a photo.
Remarks:
  • Universal Windows 10 App CameraRunApp must be executed in a thread.
  • 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 saved in the file " + sPhoto)
END
nRecordingType is int
 
// Let the user choose the type of capture
FI Dialog("Do you want to take a photo or record a video?", ["A photo", ...
"A video"], 1, 2, dlgIconQuestion) = 1 THEN
nRecordingType = viPictureCapture
ELSE
nRecordingType = viVideoCapture
END
 
// Starts the application
CameraRunApp(nRecordingType, CameraRunApp_Callback)
 
INTERNAL PROCEDURE CameraRunApp_Callback(sPath is string)
 
// If the return is an empty string vide (""), an error occurred
IF sPath ~= "" THEN
Error(ErrorInfo())
RETURN
END
 
// Message for end of recording
Info("The file was saved here: " + sPath)
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:
viPictureCaptureSaving a photo.
viVideoCapture
(Default value)
Capture a video sequence.

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:
viPictureCaptureSaving a photo.
viVideoCapture
(Default value)
Capture a video sequence.
<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

Universal Windows 10 App In the applications in Windows Store apps mode, the photos and the videos are saved in the "TempState" directory of the application.
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of several application features in the application generation wizard.
Required features:
  • Microphone: This feature allows the applications to perform audio recordings.
  • WebCam: This feature allows the applications to capture videos or photos.
Business / UI classification: UI Code
Component: wd290android.aar
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help