Canvas Toolkit
← Class index

CImageView

Widgets · extends CScrollArea

Image viewer with anchored wheel zoom, fit mode and drag panning.

import { CImageView } from "canvas-toolkit-lib";

Declared members

static readonly MinimumZoom = 0.000001;
static readonly MaximumZoom = 64;
readonly zoomChanged: CSignal<[number]>;
constructor(parent?: CWidget | null);
pixmap(): CPixmap | null;
setPixmap(pixmap: CPixmap | null): void;

Invalid or null images clear the viewer. New images start in fit mode.

clear(): void;
zoomFactor(): number;
isFitToWindow(): boolean;
checkerboardVisible(): boolean;
setCheckerboardVisible(visible: boolean): void;
sizeHint(): CSize;
cursor(): CCursorShape;
setZoomFactor(factor: number, anchor?: CPoint): void;

Sets magnification around a viewport-relative anchor (centre by default).

zoomIn(): void;
zoomOut(): void;
actualSize(): void;
fitToWindow(): void;
imageRect(): CRect;

Image bounds in the scrolled content coordinate system.

setGeometry(x: number, y: number, width: number, height: number): void;
setVisible(visible: boolean): void;
setEnabled(enabled: boolean): void;
destroy(): void;
protected wheelEvent(event: CWheelEvent): void;
protected mousePressEvent(event: CMouseEvent): void;
protected mouseMoveEvent(event: CMouseEvent): void;
protected mouseReleaseEvent(event: CMouseEvent): void;
protected mouseDoubleClickEvent(event: CMouseEvent): void;
protected keyPressEvent(event: CKeyEvent): void;