PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV Mobile 27 feature!
  • Overview
  • Control of a WINDEV Mobile window
  • Creating a Camera control
  • Smart control
  • Available features
  • Camera control in version 27 and later
  • Camera control in version 26 and earlier
  • Managing thumbnails
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
Overview

Control of a WINDEV Mobile window

The Camera control is used to:
You can save this video or save a video snapshot.
Remark: You can use the native camera of the device to record a video or take a photo (CameraRunApp).
Versions 16 and later
Android This control is now available for Android applications.
New in version 16
Android This control is now available for Android applications.
Android This control is now available for Android applications.
Versions 21 and later
AndroidiPhone/iPad The Video control can now decode bar codes in Android and iPhone/iPad applications.
New in version 21
AndroidiPhone/iPad The Video control can now decode bar codes in Android and iPhone/iPad applications.
AndroidiPhone/iPad The Video control can now decode bar codes in Android and iPhone/iPad applications.

Creating a Camera control

To create a Camera control:
  1. On the "Creation" tab, in the "Graphic controls" group, click "Camera".
  2. Click at the desired location to create the control. The control appears in the editor.
To view the characteristics of the control, select "Description" in the context menu.
The Camera control can be handled programmatically using the Camera functions.
Versions 23 and later
Remark: These functions are also available with a prefix syntax. For more details, see Camera functions (Prefix syntax).
New in version 23
Remark: These functions are also available with a prefix syntax. For more details, see Camera functions (Prefix syntax).
Remark: These functions are also available with a prefix syntax. For more details, see Camera functions (Prefix syntax).
Remarks:
  • A single Camera control can be used in a window.
  • Versions 27 and later
    The Camera control exists in 2 versions:
    • Mode 27 or higher: Camera control created in version 27. It allows using all the new functions and properties available from version 27 onwards (see below).
    • Version-26-compatible mode: Camera control created before version 26. It uses features deprecated by Google. The "Version-26-compatible" mode, available in the control description window, is used to keep the same behavior as in previous versions. If this option is unchecked, the control will be set to mode 27 or higher.
    New in version 27
    The Camera control exists in 2 versions:
    • Mode 27 or higher: Camera control created in version 27. It allows using all the new functions and properties available from version 27 onwards (see below).
    • Version-26-compatible mode: Camera control created before version 26. It uses features deprecated by Google. The "Version-26-compatible" mode, available in the control description window, is used to keep the same behavior as in previous versions. If this option is unchecked, the control will be set to mode 27 or higher.
    The Camera control exists in 2 versions:
    • Mode 27 or higher: Camera control created in version 27. It allows using all the new functions and properties available from version 27 onwards (see below).
    • Version-26-compatible mode: Camera control created before version 26. It uses features deprecated by Google. The "Version-26-compatible" mode, available in the control description window, is used to keep the same behavior as in previous versions. If this option is unchecked, the control will be set to mode 27 or higher.
Versions 27 and later

Smart control

WINDEV Mobile features a Smart control to use the camera of the device. All the main functionalities are integrated in this Smart control. It has a Button control (to be added in the window that will open the camera of the device) and a window (opened by the Button control).
To add the Smart control in your window:
  1. In the editor, open the window in which the camera button will be integrated.
  2. On the "Creation" tab, in the "Graphic controls" group, expand "Camera".
  3. Click the control that appears and then click in the window to set the position of the button. The button is created and the "WIN_Mobile_Camera_UI" window is added to the project. This window contains different planes that allow you to manage photo capture and video recording.
New in version 27

Smart control

WINDEV Mobile features a Smart control to use the camera of the device. All the main functionalities are integrated in this Smart control. It has a Button control (to be added in the window that will open the camera of the device) and a window (opened by the Button control).
To add the Smart control in your window:
  1. In the editor, open the window in which the camera button will be integrated.
  2. On the "Creation" tab, in the "Graphic controls" group, expand "Camera".
  3. Click the control that appears and then click in the window to set the position of the button. The button is created and the "WIN_Mobile_Camera_UI" window is added to the project. This window contains different planes that allow you to manage photo capture and video recording.

Smart control

WINDEV Mobile features a Smart control to use the camera of the device. All the main functionalities are integrated in this Smart control. It has a Button control (to be added in the window that will open the camera of the device) and a window (opened by the Button control).
To add the Smart control in your window:
  1. In the editor, open the window in which the camera button will be integrated.
  2. On the "Creation" tab, in the "Graphic controls" group, expand "Camera".
  3. Click the control that appears and then click in the window to set the position of the button. The button is created and the "WIN_Mobile_Camera_UI" window is added to the project. This window contains different planes that allow you to manage photo capture and video recording.
Available features

Camera control in version 27 and later

From version 27 onwards, all new Camera controls can be handled programmatically:
  • via the following functions:
    Versions 22 and later
    CameraStopDecoding
    New in version 22
    CameraStopDecoding
    CameraStopDecoding
    Stops decoding bar codes in a Camera control.
    Versions 22 and later
    CameraStartDecoding
    New in version 22
    CameraStartDecoding
    CameraStartDecoding
    Starts decoding bar codes in a Camera control.
    Versions 27 and later
    CameraPhoto
    New in version 27
    CameraPhoto
    CameraPhoto
    Captures a photo via a Camera control in an Android or iOS application.
    Versions 27 and later
    CameraVideoStop
    New in version 27
    CameraVideoStop
    CameraVideoStop
    Stops the video recording previously started by CameraVideoStart.
    Versions 27 and later
    CameraVideoStart
    New in version 27
    CameraVideoStart
    CameraVideoStart
    Starts recording a video via a Camera control in an Android or iOS application.
  • via the following specific properties:
    Versions 27 and later
    TapToFocus
    New in version 27
    TapToFocus
    TapToFocus
    The TapToFocus property is used to:
    • Determine if tap to focus is enabled in a Camera control.
    • Enable or disable tap to focus in a Camera control.
    Versions 27 and later
    Camera
    New in version 27
    Camera
    Camera
    The Camera property is used to identify and change the camera used (back or front).
    Versions 27 and later
    Flash
    New in version 27
    Flash
    Flash
    The Flash property determines and changes the flash mode in a Camera control.
    Versions 27 and later
    DisplayModePreview
    New in version 27
    DisplayModePreview
    DisplayModePreview
    The DisplayModePreview property gets and sets the camera preview mode.
    Versions 26 and later
    WorkingDirectory
    New in version 26
    WorkingDirectory
    WorkingDirectory
    The WorkingDirectory property is used to:
    • identify or change the directory used by the HTML Editor control to store the images and CSS sheets of an HTML page.
    • identify the directory used by the HTML Display control to store the images and CSS sheets of an HTML page.
    • identify the directory used by the Camera control to save photos and videos.
    Versions 27 and later
    Torch
    New in version 27
    Torch
    Torch
    The Torch property is used to determine and change how a Camera control uses the torch.
    Versions 12 and later
    Zoom
    New in version 12
    Zoom
    Zoom
    The Zoom property is used to get or change the zoom value:
    • in an Image control.
    • in a Map control.
    • in an Organization Chart control.
    • in a Table, TreeView Table, Pivot Table, Spreadsheet or List Box control.
    • in a Word Processing control.
    • in a PDF Reader control.
    • in a Camera control.
    • in a Diagram Editor control;
    • in a window.
    Versions 22 and later
    ZoomWithFinger
    New in version 22
    ZoomWithFinger
    ZoomWithFinger
    The ZoomWithFinger property is used to:
    • determine if an Image or Camera control supports pinch zoom.
    • enable or disable pinch zoom in an Image or Camera control.
    Versions 27 and later
    MaxZoom
    New in version 27
    MaxZoom
    MaxZoom
    The MaxZoom property is used to get the maximum zoom value that can be used for the Camera control (for the camera in use).
    Versions 27 and later
    MinZoom
    New in version 27
    MinZoom
    MinZoom
    The MinZoom property is used to get the minimum zoom value that can be used for the Camera control (for the camera in use).
Only the video being captured can be viewed in a Camera control.
Audio recording:
  • Android Audio is always recorded.
  • iPhone/iPad Audio recording can be enabled or disabled via the "Enable audio recording" option.
To view:
Remark: If you are using a Camera control created in version 27 (or if the "Version-26-compatible" option is unchecked):
  • The VideoParameter function is ignored by the Camera control.
  • The following functions are not available:
    Versions 22 and later
    CameraDisplay
    New in version 22
    CameraDisplay
    CameraDisplay
    Displays the video being captured by a web camera or by the camera of a mobile device in a "Camera" control.
    AndroidiPhone/iPad Function kept for "Version-26-compatible" Camera controls.
    Versions 22 and later
    CameraStop
    New in version 22
    CameraStop
    CameraStop
    Stops playing or recording a video sequence in a Camera control.
    AndroidiPhone/iPad Function kept for "Version-26-compatible" Camera controls.
    Versions 22 and later
    CameraCapture
    New in version 22
    CameraCapture
    CameraCapture
    Saves the video currently transmitted by a "camera" as an image or a video sequence.
    AndroidiPhone/iPad Function kept for "Version-26-compatible" Camera controls.
    Versions 22 and later
    CameraStatus
    New in version 22
    CameraStatus
    CameraStatus
    Returns the status of a Camera control.
    AndroidiPhone/iPad Function kept for "Version-26-compatible" Camera controls.

Camera control in version 26 and earlier

If you used the Camera control in previous versions, the control is automatically set to "Version-26-compatible" mode when you upgrade the project to version 27. In this mode:
  • The new properties and functions in version 27 are not available and cause a fatal error.
  • When taking a photo:
    • the autofocus is taken into account if it is enabled.
    • the orientation of the camera is taken into account for the final orientation of the photo.
  • The click code on the Camera control allows you to trigger the photo capture or to start recording a clip (and to stop).
Only the video being captured can be viewed in a Camera control.
To view:
Android

Managing thumbnails

If photos must be used in Android applications, we advise you to work with thumbnails and not with the initial photos taken by the device. These thumbnails can be generated by CameraGenerateThumbnail.
This example presents how to take photos and generate thumbnails.
sImageFile is string
sThumbnail is string
 
// Takes a photo with the camera of the Android device
sImageFile = CameraRunApp(viVideoCapture)
IF sImageFile = "" THEN
Error("Unable to take the photo.", ErrorInfo())
RETURN
END
 
// Generates a thumbnail from the photo taken by the device
// and displays the thumbnail in an Image control
sThumbnail = fExtractPath(sImageFile, fDrive + fDirectory + fFileName) + "_thumb.jpg"
IF CameraGenerateThumbnail(sImageFile, sThumbnail) = True THEN
IMG_Photo = sThumbnail
ELSE
Error("Unable to generate the thumbnail.", ErrorInfo())
END
Related Examples:
The Camera functions Unit examples (WINDEV Mobile): The Camera functions
[ + ] Using the WLanguage "Camera" functions to start the native video camera application of the device in order to record a video or to take a photo.
WM System Cross-platform examples (WINDEV Mobile): WM System
[ + ] This application is an example of some of the features of WINDEV Mobile available for Android/iOS.
The following system functions are used:
- NFC
- Multimedia control
- Brightness
- Volume
- Wi-Fi
- Bluetooth
- Toast
- Compass
- Accelerometer
- Camera control
- LED
- Vibration
- Notifications
- Drawing functions
- Internet
Minimum version required
  • Version 27
Comments
Click [Add] to post a comment