Silk Mobile

Table of Contents (Homepage)

Pinch

Boolean Pinch(int inside, int X, int Y, int Radius)

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

Description

Pinch In/Out at specific location using a specific pinch radius.

Parameters

  • Inside: Boolean set the direction of the pinch.

    • True for Zoom In

    • False for Zoom Out

  • X: The x coordinate of the center point from top left. (can use p2cx to convert screen percentage to pixels).

  • Y: The y coordinate of the center point from top left. (can use p2cy to convert screen percentage to pixels).

  • Radius: The pinch radius in screen pixels.

Performing pinch directly on the User Interface (UI):

  • Pinch in (Zooms out): Scroll the mouse wheel down while pressing the control (CTRL) key.

  • Pinch out (Zooms in): Scroll the mouse whee up while pressing the control (CTRL) key.

Usage

Following example demonstrates how the pinch command works:

We will zoom in the Google maps:

Parameters:

  • Inside: set to- true

  • X: set to - 600

  • Y: set to - 1000

  • Radius: set to – 700

Before running the script:

images/download/attachments/3309789/8.jpg

After executing the script:

images/download/attachments/3309789/9.jpg

Code Examples

Java Example
if(client.pinch(true, 600, 1000, 700)){
// If statement
}
C# Example
if(client.Pinch(true, 600, 1000, 700))
{
// If statement
}
VBScript Example
If StrComp (client.Pinch ( true, 600, 1000, 700 ), "True") = 0 Then
Report
'If statement
Else
Report
End If
Python Example
if(self.client.pinch(True, 600, 1000, 700)):
# If statement
pass
Perl Example
if($client->pinch(1, 600, 1000, 700)){
# If statement