ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / WINDEV Mobile specific features
  • Overview
  • Image control description: Options specific to multi-touch
  • Special case: Managing the click areas
  • Optional events specific to multi-touch
  • Scroll with finger optional event
  • Horizontal and vertical swipe
  • "Zoom with fingers" optional process
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
One of the most common applications of the multi-touch feature is used to handle images. Since mobile devices usually have smaller screens, sometimes it is necessary to zoom and move images.
This technology allows you to zoom images with a pinch gesture.
The multi-touch can be implemented:
  • on the applications run on a phone.
  • on the sites displayed on a phone.
The management of multi-touch in the Image controls can be implemented via:
iPhone/iPad Remark: The management of multi-touch is also available for Chart controls.
WEBDEV - Server codeWEBDEV - Browser code Use conditions:
  • On the default Android browser, multi-touch is supported from Android version 3.0 and later.
  • On the default Android browser, the zoom of gestures may conflict with the default zoom of the browser for the versions earlier than Android 4.3.
Image control description: Options specific to multi-touch
The "Details" tab in the window description of the Image control is used to manage the actions performed when using the fingers:
The following options are supported:
  • No scroll, no zoom: in this case, multi-touch is disabled.
  • Automatic scrolling only: If the image is not displayed in its entirety the control, it can be moved by scrolling with the finger.
  • Automatic scrolling and zoom: In addition to scrolling, zoom is also supported. In this case:
    • moving two fingers away from each other on the screen allows zooming in. The zoom will be centered on the point found in the middle of the line drawn by the two contact points.
    • moving two fingers towards each other on the screen allows zooming out.
The additional options are used to define:
  • AndroidAndroid Widget iPhone/iPad Initial display mode of the image. The image can be displayed in one of the following modes:
    • 100% centered: the image is displayed at 100% and it is centered in the control.
    • Homothetic centered: The image is enlarged or reduced while respecting the proportions of the initial image so that it is entirely displayed in the control and it is centered in the control.
    • Homothetic centered extended: The image is enlarged or reduced while respecting the proportions of the initial image so that the smallest side of the image is entirely displayed in the image control and so that the image is centered in the control.
  • Maximum zoom factor: Maximum zoom that can be performed with the fingers.
  • Allow zoom by double tap: In this case, a double tap (or double click) performed in the control is used to apply the zoom on an image section. If the image is already zoomed, it is reinitialized to its initial display.
AndroidAndroid Widget iPhone/iPad Remark: The multi-touch features of the Image control cannot be used if the window includes a scrollbar.
AndroidAndroid Widget iPhone/iPad

Special case: Managing the click areas

If the image is considered as being a click area ("This image is a click area" option in the "Details" tab of control description), you can:
  • manage the first touch on the image (default operating mode in the earlier versions): If multi-touch used on the image, the different corresponding events (finger pressed, click, etc.) will be called only with the first single touch.
  • manage multi-touch on the image ("Recall processes for each pointer (multiple pointers)"): If multi-touch used on the image, the different corresponding events (finger pressed, click, etc.) will be called with every additional touch.
    iPhone/iPad If the scroll or zoom features are enabled, the option "Recall processes for each pointer (multiple pointers)" is ignored.
Optional events specific to multi-touch
There are three specific optional events to manage multi-touch on Image controls:
WEBDEV - Server codeWEBDEV - Browser code Remark: These are browser events.

Scroll with finger optional event

The "Scroll with finger" event is run when one or more fingers move vertically or horizontally while in contact with the screen
This event can accept parameters by declaring a procedure directly in the "Scroll with finger" event with the following syntax:
PROCEDURE <Procedure name>(<Distance X>, <Distance Y>)
where:
  • <Distance X>: Integer corresponding to the distance (in pixels) that was scrolled on the X axis in the control.
  • <Distance Y>: Integer corresponding to the distance (in pixels) that was scrolled on the Y axis in the control.
Remarks:
  • Android The distance corresponds to the distance between the last contact point that was detected and the current position.
  • WEBDEV - Browser codeiPhone/iPad The distance corresponds to the distance between the first contact point that was detected and the current position.
WEBDEV - Browser codeAndroid To find out the direction and the distance for the operation performed, you have the ability to use the Gesture variable instead of the procedure.

Horizontal and vertical swipe

The "Horizontal and vertical swipe" event is run during a quick small movement of one or more fingers on the screen.
This event can accept parameters by declaring a procedure directly in the "Horizontal and vertical swipe" event with the following syntax:
PROCEDURE <Procedure name>(<Speed X>, <Speed Y>)
where:
  • <Speed X>: Integer corresponding to the speed (in pixels per second) of the movement on the X axis.
  • <Speed Y>: Integer corresponding to the speed (in pixels per second) of the movement on the Y axis.
WEBDEV - Browser codeAndroid To find out the direction and the speed for the operation performed, you have the ability to use the Gesture variable instead of the procedure.

"Zoom with fingers" optional process

The "Zoom with fingers" event is run with a pinch or spread finger gesture on the screen.
This event can accept parameters by declaring a procedure directly in the "Zoom with fingers" event with the following syntax:
PROCEDURE <Procedure name>(<Spacing>)
where <Spacing>: Integer corresponding to the distance (in pixels) between the two contact points when the event was called.
WEBDEV - Browser codeAndroid To find out the spacing, you have the ability to use the Gesture variable instead of the procedure.
iPhone/iPad The use of parameters in this event by declaring a procedure is not available.
Caution: The zoom with finger is not available if dStartDrawing is used on the Image control. In this case, you must:
  • save the image with a dSaveImageXXX function.
  • use the dEndDrawing function.
  • redisplay the image in the Image control.
Related Examples:
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 17
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help