NAME
Prima::ImageViewer - standard image, icon, and bitmap viewer class.
DESCRIPTION
The module contains Prima::ImageViewer class, which provides image displaying functionality, including different zoom levels.
Prima::ImageViewer is a descendant of Prima::ScrollWidget and inherits its document scrolling behavior and programming interface. See Prima::ScrollWidget for details.
API
Properties
- alignment INTEGER
-
One of the following
ta::XXXconstants:ta::Left ta::Center ta::RightSelects the horizontal image alignment.
Default value:
ta::Left - image OBJECT
-
Selects the image object to be displayed. OBJECT can be an instance of
Prima::Image,Prima::Icon, orPrima::DeviceBitmapclass. - imageFile FILE
-
Set the image FILE to be loaded and displayed. Is rarely used since does not return a loading success flag.
- quality BOOLEAN
-
A boolean flag, selecting if the palette of
imageis to be copied into the widget palette, providing higher visual quality on paletted displays. See also "palette" in Prima::Widget.Default value: 1
- valignment INTEGER
-
One of the following
ta::XXXconstants:ta::Top ta::Middle or ta::Center ta::BottomSelects the vertical image alignment.
NB:
ta::Middlevalue is not equal tota::Center's, however the both constants produce equal effect here.Default value:
ta::Bottom - zoom FLOAT
-
Selects zoom level for image display. The acceptable value range is between 0.02 and 100. The zoom value is rounded to fiftieth and twentieth fractional values - .02, .04, .05, .06, .08, and 0.1 .
Default value: 1
Methods
- screen2point X, Y, [ X, Y, ... ]
-
Performs translation of integer pairs integers as (X,Y)-points from widget coordinates to pixel offset in image coordinates. Takes in account zoom level, image alignments, and offsets. Returns array of same length as the input.
Useful for determining correspondence, for example, of a mouse event to a image point.
The reverse function is
point2screen. - point2screen X, Y, [ X, Y, ... ]
-
Performs translation of integer pairs as (X,Y)-points from image pixel offset to widget image coordinates. Takes in account zoom level, image alignments, and offsets. Returns array of same length as the input.
Useful for determining a screen location of an image point.
The reverse function is
screen2point.
AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.
SEE ALSO
Prima, Prima::Image, Prima::ScrollWidget, examples/iv.pl.