当前位置: 首页>>代码示例>>C#>>正文


C# InkCanvas.Select方法代码示例

本文整理汇总了C#中System.Windows.Controls.InkCanvas.Select方法的典型用法代码示例。如果您正苦于以下问题:C# InkCanvas.Select方法的具体用法?C# InkCanvas.Select怎么用?C# InkCanvas.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.InkCanvas的用法示例。


在下文中一共展示了InkCanvas.Select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectCanvas

        public void SelectCanvas(int canvasIndex)
        {
            InkCanvas oldInkCanvas = _currentInkCanvas;
            _currentInkCanvas = (InkCanvas)_canvasList.Children[canvasIndex];

            //copy images & strokes
            if (oldInkCanvas != null)
            {
                foreach (Image uIElement in oldInkCanvas.GetSelectedElements().OfType<Image>())
                {
                    oldInkCanvas.Children.Remove(uIElement);
                    _currentInkCanvas.Children.Add(uIElement);
                }
                foreach (Stroke stroke in oldInkCanvas.GetSelectedStrokes())
                {
                    if (Keyboard.IsKeyDown(Key.LeftShift)) _currentInkCanvas.Strokes.Add(stroke.Clone());
                    if (Keyboard.IsKeyDown(Key.LeftAlt))
                    {
                        oldInkCanvas.Strokes.Remove(stroke);
                        _currentInkCanvas.Strokes.Add(stroke);
                    }
                }
            }

            //hide all canvases
            foreach (InkCanvas inkCanvas in _canvasList.Children)
            {
                inkCanvas.Opacity = .2;
                inkCanvas.IsHitTestVisible = false;
            }

            _currentInkCanvas.IsHitTestVisible = true;
            _currentInkCanvas.Opacity = 1;
            //SetMode(InkCanvasEditingMode.Select, CustomMode.select);
            _currentInkCanvas.Select(new StrokeCollection());
            if (null != oldInkCanvas)
                oldInkCanvas.Select(new StrokeCollection());
        }
开发者ID:vonhacker,项目名称:counterstrike,代码行数:38,代码来源:UserControlCanvas.xaml.cs

示例2: SelectCanvas

        public void SelectCanvas(int i)
        {
            InkCanvas _oldInkCanvas = _InkCanvas;
            _InkCanvas = (InkCanvas)_CanvasList.Children[i];

            if (_oldInkCanvas != null)
            {

                foreach (Image _UIElement in _oldInkCanvas.GetSelectedElements().OfType<Image>().ToList())
                {
                    _oldInkCanvas.Children.Remove(_UIElement);
                    _InkCanvas.Children.Add(_UIElement);
                }
                foreach (Stroke _Stroke in _oldInkCanvas.GetSelectedStrokes())
                {
                    if (Keyboard.IsKeyDown(Key.LeftShift)) _InkCanvas.Strokes.Add(_Stroke.Clone());
                    if (Keyboard.IsKeyDown(Key.LeftAlt))
                    {
                        _oldInkCanvas.Strokes.Remove(_Stroke);
                        _InkCanvas.Strokes.Add(_Stroke);
                    }
                }
            }
            foreach (InkCanvas _InkCanvas1 in _CanvasList.Children)
            {
                _InkCanvas1.Opacity = .2;
                _InkCanvas1.IsHitTestVisible = false;
            }

            _InkCanvas.IsHitTestVisible = true;
            _InkCanvas.Opacity = 1;
            //SetMode(InkCanvasEditingMode.Select, CustomMode.select);
            _InkCanvas.Select(new StrokeCollection());
            if (null != _oldInkCanvas)
                _oldInkCanvas.Select(new StrokeCollection());
        }
开发者ID:vonhacker,项目名称:counterstrike,代码行数:36,代码来源:Window1.xaml.cs


注:本文中的System.Windows.Controls.InkCanvas.Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。