Exemplo n.º 1
0
        protected virtual CaptureMouseMoveEventArgs CreateArgs()
        {
            CaptureMouseMoveEventArgs e = new CaptureMouseMoveEventArgs(
                this,
                this.myStartPosition,
                this.myCurrentPosition);

            return(e);
        }
Exemplo n.º 2
0
        protected virtual void OnDraw(bool ResumeView)
        {
            if (this.ReversibleShape == ReversibleShapeStyle.Custom)
            {
                if (Draw != null)
                {
                    CaptureMouseMoveEventArgs args = this.CreateArgs();
                    args.ResumeView = ResumeView;
                    Draw(this, args);
                }
            }
            else
            {
                ReversibleDrawer drawer = null;
                if (myBindControl == null)
                {
                    drawer = ReversibleDrawer.FromScreen();
                }
                else
                {
                    drawer = ReversibleDrawer.FromHwnd(myBindControl.Handle);
                }

                drawer.PenStyle  = PenStyle.PS_SOLID;
                drawer.PenColor  = Color.White;
                drawer.LineWidth = 1;

                Rectangle rect = GetRectangle(this.StartPosition, this.CurrentPosition);
                switch (this.ReversibleShape)
                {
                case ReversibleShapeStyle.Rectangle:
                    drawer.DrawRectangle(rect);
                    break;

                case ReversibleShapeStyle.Ellipse:
                    drawer.DrawEllipse(rect);
                    break;

                case ReversibleShapeStyle.Line:
                    drawer.DrawLine(this.StartPosition, this.CurrentPosition);
                    break;

                case ReversibleShapeStyle.FillRectangle:
                    drawer.FillRectangle(rect);
                    break;
                }
                drawer.Dispose();
            }
        }