C# Класс SANTA.UI.ZPImageBox

A zoom-able, pan-able image box for displaying and navigating around images.
Наследование: System.Windows.Forms.ScrollableControl
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
_dragging bool
_image Image
_imageFocus Point
_mode Mode
_multipleFiles bool
_zoom float
grabCursor System.Windows.Forms.Cursor
grabbingCursor System.Windows.Forms.Cursor

Открытые методы

Метод Описание
SetImage ( Bitmap image ) : void

Change the currently displayed image.

SetImage ( Bitmap image, bool reset ) : void

Change the currently displayed image

SetMultipleFileMode ( bool multipleFiles ) : void

Change if multiple files are selected or not. Multiple images cannot be displayed if this is set to true.

ZPImageBox ( ) : System

Construct a ZPImageBox

Защищенные методы

Метод Описание
Box2ImageCoord ( Point boxCoord ) : Point

Convert a point from mouse coordinates to image coordinates.

Near ( Point a, Point b, float dist ) : bool

Determine if two points are within a certain distance of each other.

ResetImage ( bool moveToBoxCenter ) : void

Change the zoom level so the image is entirely viewable.

Приватные методы

Метод Описание
DrawImage ( object sender, PaintEventArgs e ) : void

Paint the image to the box.

SetEventHandlers ( ) : void
ZPImageBox_KeyDown ( object sender, KeyEventArgs e ) : void

If the Control key was pressed, put the image into Manipulate mode.

ZPImageBox_KeyUp ( object sender, KeyEventArgs e ) : void

If the Control key was released, put the image into Navigate mode.

ZPImageBox_MouseDown ( object sender, MouseEventArgs e ) : void

Handle navigation interaction

ZPImageBox_MouseEnter ( object sender, EventArgs e ) : void

This needs to grab focus when the mouse enters so that input can be handled.

ZPImageBox_MouseMove ( object sender, MouseEventArgs e ) : void

Move the image around.

ZPImageBox_MouseUp ( object sender, MouseEventArgs e ) : void

Disable dragging mode.

ZPImageBox_MouseWheel ( object sender, MouseEventArgs e ) : void

Zoom in or out of the image.

Описание методов

Box2ImageCoord() защищенный Метод

Convert a point from mouse coordinates to image coordinates.
protected Box2ImageCoord ( Point boxCoord ) : Point
boxCoord Point Coordinate in the box's coordinate system.
Результат Point

Near() защищенный статический Метод

Determine if two points are within a certain distance of each other.
protected static Near ( Point a, Point b, float dist ) : bool
a Point First point.
b Point Second Point.
dist float The
Результат bool

ResetImage() защищенный Метод

Change the zoom level so the image is entirely viewable.
protected ResetImage ( bool moveToBoxCenter ) : void
moveToBoxCenter bool Should the image be moved back to the center of the box
Результат void

SetImage() публичный Метод

Change the currently displayed image.
public SetImage ( Bitmap image ) : void
image System.Drawing.Bitmap The new image to display.
Результат void

SetImage() публичный Метод

Change the currently displayed image
public SetImage ( Bitmap image, bool reset ) : void
image System.Drawing.Bitmap The new image to display
reset bool Whether to reset the zoom level and focal point
Результат void

SetMultipleFileMode() публичный Метод

Change if multiple files are selected or not. Multiple images cannot be displayed if this is set to true.
public SetMultipleFileMode ( bool multipleFiles ) : void
multipleFiles bool Are multiple files selected
Результат void

ZPImageBox() публичный Метод

Construct a ZPImageBox
public ZPImageBox ( ) : System
Результат System

Описание свойств

_dragging защищенное свойство

Is the _image being dragged/moved around.
protected bool _dragging
Результат bool

_image защищенное свойство

Image to display
protected Image _image
Результат Image

_imageFocus защищенное свойство

_imageFocus is the point in the image's coordinate system that corresponds to the _boxFocus, which is the point in the ZPImageBox coordinate system where the user last clicked when moving the image.
protected Point _imageFocus
Результат Point

_mode защищенное свойство

The current method of interaction with the ZPImageBox.
protected Mode _mode
Результат Mode

_multipleFiles защищенное свойство

Have multiple files been selected.
protected bool _multipleFiles
Результат bool

_zoom защищенное свойство

These specify the range of scaling factors for the image.
protected float _zoom
Результат float

grabCursor защищенное статическое свойство

Cursor to use when the mouse button is depressed. It looks like an opened hand.
protected static Cursor,System.Windows.Forms grabCursor
Результат System.Windows.Forms.Cursor

grabbingCursor защищенное статическое свойство

Cursor to use when the mouse button is not depressed. It looks like a hand grabbing.
protected static Cursor,System.Windows.Forms grabbingCursor
Результат System.Windows.Forms.Cursor