You can programmatically control the GestureViewer using the useGestureViewerController hook.
useGestureViewerController API Reference| Property | Description | Type | Default |
|---|---|---|---|
goToIndex | Navigate to a specific index. | (index: number) => void | - |
goToPrevious | Navigate to the previous item. | () => void | - |
goToNext | Navigate to the next item. | () => void | - |
currentIndex | The index of the currently displayed item. | number | 0 |
totalCount | The total number of items. | number | 0 |
zoomIn | Zoom in by the specified multiplier. | (multiplier?: number) => void | 0.25 |
zoomOut | Zoom out by the specified multiplier. | (multiplier?: number) => void | 0.25 |
resetZoom | Reset zoom to the specified scale. | (scale?: number) => void | 1 |
rotate | Rotate by the specified angle. | (angle?: number, clockwise?: boolean) => void | 90, true |
zoomIn(multiplier?)
0.01 ~ 1)zoomIn(0.5) → Zoom in by an additional 50% of the current scalezoomOut(multiplier?)
0.01 ~ 1)zoomOut(0.3) → Zoom out by dividing the current scale by 1.3resetZoom(scale?)
resetZoom(1.5) → Reset to 1.5x scalerotate(angle?, clockwise?)
rotate(90) → Rotate 90 degrees clockwiserotate(90, false) → Rotate 90 degrees counter-clockwiserotate(0) → Reset rotation