Exemplo n.º 1
0
        public void MouseUpHandler(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Released)
            {
                if (rectW != 0 && rectH != 0 && currentPoint.X != 0 && currentPoint.Y != 0)
                {
                    if (rectW < 0)
                    {
                        currentPoint.X = currentPoint.X + rectW;
                        rectW          = -rectW;
                    }

                    if (rectH < 0)
                    {
                        currentPoint.Y = currentPoint.Y + rectH;
                        rectH          = -rectH;
                    }
                    RemoveTempMarker();
                    MainWindow mv = Application.Current.Windows.OfType <MainWindow>().FirstOrDefault();
                    tmpRect = DrawCanvas.Rect(currentPoint.X, currentPoint.Y, (int)rectW, (int)rectH, Brushes.Red, mv.CanvasResult, 0.3);

                    currentPoint = default(Point);
                    rectW        = 0;
                    rectH        = 0;
                }
            }
        }