ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Camera functions
  • Saving a photo
  • Use conditions:
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
Captures the images received from the camera:
  • as an image: takes a photo.
  • as a video: records 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)
// Records the video captured in the "CAM_Kitchen" control
// as a 1-minute AVI file ("C:\Temp\MyVideo.AVI")
ResSave = CaméraCapture(CAM_Kitchen, "C:\Temp\MyVideo.AVI", viVideoCapture, 60)
IF ResSave = True THEN
Info("Video successfully saved")
ELSE
Error(ErrorInfo())
END
Syntax
<Result> = CameraCapture(<Camera control> , <Name of created file> [, <Type of capture> [, <Capture duration> [, <Number of images per second> [, <Display during capture>]]]])
<Result>: Boolean
  • True if the video was successfully saved,
  • 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.
Caution: No UNC path can be used.
<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.
Remark: This parameter can be:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format ('1 s' for example).
<Number of images per second>: Optional integer
Number of images saved per second (15 by default). This parameter is taken into account only if <Type of capture> is equal to viVideoCapture.
<Display during capture>: Optional boolean
  • True (by default) if the video captured must be shown 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:
  • the dSaveImageBMP function: the photo will be saved as a BMP file.
  • the dSaveImageGIF function: the photo will be saved as a GIF file.
  • the dSaveImageJPEG function: the photo will be saved as a JPEG file.

Use conditions:

  • Windows To use this function, a "web camera" must be connected to the current computer.
Component: wd290obj.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/27/2022

Send a report | Local help