C# Class Emgu.CV.UI.PanAndZoomPictureBox

A picture box with pan and zoom functionality
Inheritance: System.Windows.Forms.PictureBox
Show file Open project: genecyber/PredatorCV

Public Properties

Property Type Description
ZoomLevels double[]

Private Properties

Property Type Description
GetSelectedRectangle System.Drawing.Rectangle
InitializeComponent void
OnMouseDown void
OnMouseEnter void
OnMouseMove void
OnMouseUp void
OnMouseWheel void
OnResize void
OnScroll void
ReverseRectangle void
SetScrollBarVisibilityAndMaxMin void

Public Methods

Method Description
PanAndZoomPictureBox ( ) : System

Create a picture box with pan and zoom functionality

SetZoomScale ( double zoomScale, Point fixPoint ) : void

Set the new zoom scale for the displayed image

Protected Methods

Method Description
GetImageSize ( ) : Size

Get the size of the image

GetViewSize ( ) : Size

Get the size of the view area

Min ( Size s1, Size s2 ) : Size

Get the minimum of the two sizes

OnPaint ( PaintEventArgs pe ) : void

Paint the image

Private Methods

Method Description
GetSelectedRectangle ( Point p1, Point p2 ) : Rectangle

Get the rectangle defined by the two points

InitializeComponent ( ) : void
OnMouseDown ( object sender, MouseEventArgs e ) : void
OnMouseEnter ( object sender, EventArgs e ) : void
OnMouseMove ( object sender, MouseEventArgs e ) : void

Used for tracking the mouse position on the image

OnMouseUp ( object sender, MouseEventArgs e ) : void
OnMouseWheel ( object sender, MouseEventArgs e ) : void
OnResize ( object sender, EventArgs e ) : void
OnScroll ( object sender, ScrollEventArgs e ) : void
ReverseRectangle ( ) : void
SetScrollBarVisibilityAndMaxMin ( ) : void

Method Details

GetImageSize() protected method

Get the size of the image
protected GetImageSize ( ) : Size
return System.Drawing.Size

GetViewSize() protected method

Get the size of the view area
protected GetViewSize ( ) : Size
return System.Drawing.Size

Min() protected static method

Get the minimum of the two sizes
protected static Min ( Size s1, Size s2 ) : Size
s1 System.Drawing.Size The first size
s2 System.Drawing.Size The second size
return System.Drawing.Size

OnPaint() protected method

Paint the image
protected OnPaint ( PaintEventArgs pe ) : void
pe PaintEventArgs The paint event
return void

PanAndZoomPictureBox() public method

Create a picture box with pan and zoom functionality
public PanAndZoomPictureBox ( ) : System
return System

SetZoomScale() public method

Set the new zoom scale for the displayed image
public SetZoomScale ( double zoomScale, Point fixPoint ) : void
zoomScale double The new zoom scale
fixPoint Point The point to be fixed, in display coordinate
return void

Property Details

ZoomLevels public static property

The available zoom levels for the displayed image
public static double[] ZoomLevels
return double[]