Пример #1
0
        protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (timeOutTimmer != null && timeOutTimmer.Enabled)
            {
                timeOutTimmer.Stop();
                timeOutTimmer.Start();
            }
            //设置左上角label和右下角toolbar鼠标跟随
            Rect temRect = innerCanvas.GetSelectionRegion();

            if (temRect == Rect.Empty)
            {
                return;
            }
            label.Content = $"选中区域大小:{temRect.Width} × {temRect.Height}   宽:{temRect.Width}   高:{temRect.Height}";
            if (label != null)
            {
                Canvas.SetLeft(label, temRect.X);
                Canvas.SetTop(label, temRect.Y - 25);
            }
            if (toolBarContrl != null)
            {
                Canvas.SetLeft(toolBarContrl, temRect.X + temRect.Width - 186);
                Canvas.SetTop(toolBarContrl, temRect.Y + temRect.Height + 3);
            }
        }
Пример #2
0
        private void ToolBarMove()
        {
            Rect temRect = innerCanvas.GetSelectionRegion();

            if (toolBarContrl != null)
            {
                Canvas.SetLeft(toolBarContrl, temRect.X + temRect.Width - toolBarContrl.ActualWidth);
                Canvas.SetTop(toolBarContrl, temRect.Y + temRect.Height);
            }
        }
Пример #3
0
        protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (timeOutTimmer != null && timeOutTimmer.Enabled)
            {
                timeOutTimmer.Stop();
                timeOutTimmer.Start();
            }
            //设置左上角label和右下角toolbar鼠标跟随
            Rect temRect = innerCanvas.GetSelectionRegion();

            label.Content = "Width:" + temRect.Width + " Height" + temRect.Height + " left:" + temRect.X + " top:" + temRect.Y;
            Canvas.SetLeft(label, temRect.X);
            Canvas.SetTop(label, temRect.Y - 25);
            //Canvas.SetLeft(toolBarContrl, temRect.X + temRect.Width - 75);
            //Canvas.SetTop(toolBarContrl, temRect.Y + temRect.Height);
        }