VistaImageEvent Class
The VistaImageEvent class manages pointer events and translates them into image manipulation actions like zooming, panning, and navigation.
Overview
Section titled “Overview”VistaImageEvent coordinates:
- Single and multi-touch gestures
- Pinch-to-zoom detection
- Pan/drag interactions when zoomed
- Momentum scrolling
- External pointer event listeners
Use Case: Created internally by VistaView. Extensions can register listeners through registerPointerListener().
Public Properties
Section titled “Public Properties”None - all properties are private.
Public Methods
Section titled “Public Methods”constructor()
Section titled “constructor()”constructor(vvw: VistaView)Creates a new event handling system for a VistaView instance.
registerPointerListener()
Section titled “registerPointerListener()”registerPointerListener(listener: (e: VistaExternalPointerListenerArgs) => void): voidRegisters an external pointer event listener. Same as calling viewer.registerPointerListener().
Parameters:
listener- Function receiving pointer event data
Example:
const eventSystem = new VistaImageEvent(viewer);
eventSystem.registerPointerListener((e) => { console.log('Event:', e.event); console.log('Pointers:', e.pointers.length); console.log('State:', e.state.zoomedIn);});start()
Section titled “start()”start(imageContainer: HTMLElement): voidStarts listening to pointer events on the specified container. Called automatically by VistaView when opening.
Parameters:
imageContainer- The element to attach event listeners to
stop()
Section titled “stop()”stop(): voidRemoves all event listeners and cleans up resources. Called automatically by VistaView when closing.
Related
Section titled “Related”- VistaView - Main controller that uses VistaImageEvent
- VistaPointers - Underlying pointer tracking system
- VistaExternalPointerListenerArgs - Event data type