# PinchGesture ## APIs PinchGesture\(options?: \{ fingers?: number, distance?: number \}\) - Parameters

Name

Type

Mandatory

Default Value

Description

fingers

number

No

2

Minimum number of fingers to trigger a pinch. The value ranges from 2 to 5.

distance

number

No

3.0

Minimum recognition distance, in vp.

## Events

Name

Description

onActionStart((event?: GestureEvent) => void)

Callback invoked when a pinch gesture is recognized.

onActionUpdate((event?: GestureEvent) => void)

Callback invoked during the movement of a pinch gesture.

onActionEnd((event?: GestureEvent) => void)

Callback invoked when the finger used for a pinch gesture is lift.

onActionCancel(event: () => void)

Callback invoked when a tap cancellation event is received after a pinch gesture is recognized.

## Example ``` @Entry @Component struct PinchGestureExample { @State scale: number = 1 build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) { Text('PinchGesture scale:' + this.scale) } .height(100).width(200).padding(20).border({ width: 1 }).margin(80) .scale({ x: this.scale, y: this.scale, z: this.scale }) .gesture( PinchGesture() .onActionStart((event: GestureEvent) => { console.info('Pinch start') }) .onActionUpdate((event: GestureEvent) => { this.scale = event.scale }) .onActionEnd(() => { console.info('Pinch end') }) ) } } ``` ![](figures/pinchgesture.gif)