Draw shape in InkCanvas using custom Stroke

Following solutions were tried

  1. using model which creates an instance of class inherited from Stroke class with overridden method void DrawCore(DrawingContext, DrawingAttributes) to draw lines, ellipses and rectangles






    There were two problems

    • select the shape by click on shape’s lines did not work
    • when eraser crossed such shape – it divides to two smaller similar shapes, instead of erasing part of lines of those shapes



  2. using model which creates an instance of original Stroke class and puts prepared StylusPoints which follows shape’s geometry drawing it by lines which can be selected and erased.  There is an issue when eraser splits the rectangle to two parts when breaks only one of lines – start point and end point are not really connected even though they are the same instance of StylusPoint class. In the second picture below top left segment is not selected when other lines are selected by click on left rectangle’s side.


Last edited May 26, 2013 at 9:56 AM by smt, version 6


No comments yet.