VistaImage Class
The VistaImage class extends VistaBox and implements image-specific functionality including responsive images, hi-res loading, and zoom/pan controls.
Overview
Section titled “Overview”VistaImage is the default content type used by VistaView for displaying images. It automatically handles:
- Progressive image loading with thumbnails
- Responsive images with
srcsetsupport - Zoom and pan interactions
- Hi-resolution image transitions
Typically, you don’t instantiate VistaImage directly - VistaView creates instances automatically. However, you can reference it when creating custom extensions.
import { VistaImage } from 'vistaview';
// Used internally by VistaViewconst image = new VistaImage(params);Public Properties
Section titled “Public Properties”Inherits all properties from VistaBox:
element- HTMLImageElement containing the imagestate- Current dimensions and transformationspos- Position relative to current imageindex- Gallery indexconfig- Image configurationorigin- Origin element informationisReady- Whether image has loadedthumb- Thumbnail element
Public Methods
Section titled “Public Methods”constructor()
Section titled “constructor()”constructor(par: VistaImageParams)Creates a new VistaImage instance with automatic image loading.
Inherited Methods
Section titled “Inherited Methods”All public methods from VistaBox are available:
init()- Initialize the imagesetSizes()- Calculate dimensionsprepareClose()- Prepare for closingcancelPendingLoad()- Cancel loadingdestroy()- Clean up resourcescloneStyleFrom()- Copy style from another instancetoObject()- Serialize current statesetInitialCenter()- Set zoom center point
Related
Section titled “Related”- VistaBox - Base class
- VistaView - Main controller
- Extensions - Creating custom content types