Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }