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
  • Saving a photo
  • Use conditions:
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Captures the images received from the camera:
  • as an image: take a photo.
  • as a video: record a video.
Depending on the platform, the following photo and video formats are used:
  • Windows BMP images or AVI videos.
Remarks:
Example
WindowsUser code (UMC)
// Enregistre la vidéo retransmise dans le champ Caméra "CAM_Cuisine"
// sous forme d'une AVI ("C:\Temp\MaVideo.AVI") de 1 minute
ResSauvegarde = CameraCapture(CAM_Cuisine, "C:\Temp\MaVideo.AVI", viVideoCapture, 60)
IF ResSauvegarde = True THEN
	Info("Vidéo correctement sauvegardée")
ELSE
	Error(ErrorInfo())
END
Syntax
<Result> = CameraCapture(<Camera control> , <Name of created file> [, <Type of capture> [, <Capture duration> [, <Images per second> [, <Preview stream>]]]])
<Result>: Boolean
  • True if the video has been saved correctly,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Camera control>: Control name
Name of the Camera control to be used. There is no need to display the video in a Camera control to save it.
<Name of created file>: Character string
Name and full (or relative) path of the file to create.
Windows When a photo is taken, a BMP file is created. When a video is recorded, an AVI file is created.
Warning It is not possible to use a UNC path.
<Type of capture>: Optional integer constant
Type of capture:
viPictureCapture
Windows Captures an image and saves it as a BMP file.

viVideoCapture
(Default value)
Windows Captures a video and saves it as an AVI file.

<Capture duration>: Optional integer or optional duration
Length of the video recording (in seconds). If this parameter is set to 0 or is not specified, the video recording will stop:
  • when VideoStop is called.
  • when there is no more space on the disk.
Note: This parameter can correspond to:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format ('1 s' for example).
<Images per second>: Optional integer
Number of frames per second (15 by default). This parameter is taken into account only if <Type of capture> is equal to viVideoCapture.
<Preview stream>: Optional boolean
  • True (by default) if the video stream must be displayed in the specified Camera control,
  • False otherwise.
Remarks

Saving a photo

Only the image displayed when CameraCapture is executed is saved as a BMP image. To save this image, you can also use:

Use conditions:

  • Windows To use this function, a "web camera" must be connected to the current computer.
Component: wd300obj.dll
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