PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Saving a photo
  • Use conditions:
  • Required permissions
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.
AndroidiPhone/iPad
Warning
Starting with version 27, this function is deprecated for Android and iOS applications. This function is kept only for Camera controls created with earlier versions and with the "Version-26-compatible mode" option enabled ("General" tab of the control description window).
Depending on the platform, the following photo and video formats are used:
  • WINDEVWindows BMP images or AVI videos.
    If the file extension is .jpg or .jpeg, the image is saved in JPEG format
  • Android JPEG images or videos. The format and quality of the video depend on the default device settings and may differ from one device to another.
  • iPhone/iPad JPEG images or videos. The format and quality of the video depend on the default device settings and may differ from one device to another.
AndroidiPhone/iPad Remark: To get a photo or video using the device's native camera application, use VideoStartApp.
Example
WINDEVReports and QueriesUser code (UMC)
// Records the video captured in the "CAM_Kitchen" control
// as a 1-minute AVI file ("C:\Temp\MyVideo.AVI")
ResSave = CAM_Kitchen.Capture("C:\Temp\MyVideo.AVI", viVideoCapture, 60)
IF ResSave = True THEN
Info("Video successfully saved")
ELSE
Error(ErrorInfo())
END
Syntax
<Result> = <Camera control>.Capture(<File to create> [, <Type of capture> [, <Capture duration> [, <Number of images per second> [, <Display during capture>]]]])
<Result>: Boolean
  • True if the video was recorded successfully,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Camera control>: Control name
Name of the Camera control to be used.
<File to create>: Character string
Name and full (or relative) path of the file to create.
Android When a photo is taken, a JPEG file is created. If a video is recorded, the format and quality of the video will depend on the default settings of the device and may differ from one device to another.
WINDEVWindows 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
WINDEVWindows Captures an image and saves it as a BMP file.

Android Captures an image and saves it as a JPEG file.
viVideoCapture
(Default value)
WINDEVWindows Captures a video and saves it as an AVI file.

Android If a video is recorded, the format and quality of the video will depend on the default settings of the device and may differ from one device to another.
<Capture duration>: Optional integer
Length of the video recording (in seconds). If this parameter is set to 0 or is not specified, the video recording will stop:This parameter can be:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s or 10 ms).
<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.
AndroidiPhone/iPad This parameter is ignored. The video saved is always displayed in the Camera control.
Remarks

Saving a photo

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

Use conditions:

  • WINDEVWindows To use this function, a "web camera" must be connected to the current computer.
  • Android This function requires a device equipped with a camera. It can also be used during an execution in the Android emulator (for the capture of images only).
  • Android To get and set the camera settings, use VideoParameter and VideoListParameter.
Android

Required permissions

The call to this function modifies the permissions required by the application.
Required permissions:
  • CAMERA: This permission allows the applications to access the camera.
  • RECORD_AUDIO: This permission allows the applications to record the sound.
Component: wd270obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
video Capture
https://youtu.be/0sv8F0V0-gw
https://windevdesenvolvimento.blogspot.com/2019/09/dicas-2278-windev-webdev-mobile-camera.html
// BTN_TIRAr_FOTO
CAM_CAMERA.Capture("C:\TEMP\FOTO.JPEG",viPictureCapture,2)
IMG_FOTO="C:\TEMP\FOTO.JPEG"
amarildo
08 Sep. 2019
video Capture
https://youtu.be/i1x0L20j-u8
// BTN INICIA GRAVACAO
CAM_CAMERA.Capture("C:\temp\teste.mp4",viVideoCapture,0)
amarildo
29 Aug. 2019