C# 클래스 SANTA.UI.ZPImageBox

A zoom-able, pan-able image box for displaying and navigating around images.
상속: System.Windows.Forms.ScrollableControl
파일 보기 프로젝트 열기: siegleal/iSanta

보호된 프로퍼티들

프로퍼티 타입 설명
_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