AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Controles, páginas y ventanas / Funciones Cámara
  • Saving a photo
  • Use conditions:
  • Required permissions
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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.
  • 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.
Remarks:
  • AndroidiPhone/iPad To capture a photo or video using the device's native camera application, use CameraRunApp.
  • This function is equivalent to VideoCapture.
AndroidiPhone/iPad
Advertencia
A partir de la versión 27, esta función queda obsoleta para aplicaciones Android e iOS. Esta función solo se conserva para controles Cámara creados con versiones anteriores y con la opción "Modo compatible con la versión 26" activada (pestaña "General" de la ventana de descripción del control).
Ejemplo
WindowsCódigo de Usuario (UMC)
// Saves the video captured in the "CAM_Kitchen" control
// as a 1-minute AVI file ("C:\Temp\MyVideo.AVI")
ResSave = CameraCapture(CAM_Kitchen, "C:\Temp\MyVideo.AVI", viVideoCapture, 60)
IF ResSave = True THEN
	Info("Video successfully saved")
ELSE
	Error(ErrorInfo())
END
Sintaxis
<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.
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.
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.

Android Captures an image and saves it as a JPEG file.
viVideoCapture
(Default value)
Windows 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 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.
AndroidiPhone/iPad This parameter is ignored. The preview stream is always displayed in the Camera control.
Observaciones

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.
  • Android This function requires a device equipped with a camera. It can also be used in the Android emulator (only to capture images)
  • Android To get and set the camera settings, use VideoParameter and VideoListParameter.
Android

Required permissions

This function changes the permissions required by the application.
Required permissions:
  • CAMERA: This permission allows applications to access the camera.
  • RECORD_AUDIO: This permission allows applications to record sound.
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 22
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 25/03/2025

Señalar un error o enviar una sugerencia | Ayuda local