예제 #1
0
 private void OnColorPick_cp(object sender, RoutedPropertyChangedEventArgs <System.Windows.Media.Color?> e)
 {
     if (!(bool)changeColor_btn.IsChecked)
     {
         MyStrokeCollection strokeCollection = new MyStrokeCollection(InkCanvas.GetSelectedStrokes());
         colorHandler.onColorPick(InkCanvas, colorPicker, canvasObjectHandler.getPolygonShape().getPolygon());
         canvasObjectHandler.getPolygonShape().replaceSelectedStroke(InkCanvas);
     }
 }
예제 #2
0
        public void replaceSelectedStroke(InkCanvas _InkCanvas)
        {
            MyStrokeCollection strokeCollection = new MyStrokeCollection(_InkCanvas.GetSelectedStrokes());

            printPolygon(strokeCollection, _InkCanvas);
            foreach (Stroke aStroke in strokeCollection)
            {
                _InkCanvas.Strokes.Remove(aStroke);
            }
        }
예제 #3
0
        public void printPolygon(MyStrokeCollection _strokeCollection, InkCanvas _InkCanvas)
        {
            MyStrokeCollection strokeCollections = new MyStrokeCollection(_strokeCollection);

            for (int i = 0; i < strokeCollections.Count; i++)
            {
                for (int j = 0; j < strokeCollections[i].StylusPoints.Count; j++)
                {
                    polygon.Points.Add(strokeCollections[i].StylusPoints[j].ToPoint());
                }
            }
            _InkCanvas.Children.Add(polygon);
        }