InkStroke.DrawingAttributes
에 대해 InkDrawingAttributes
을 새로 설정하여 잉크 캔버스에있는 잉크 스트로크를 다시 그릴 수 있습니다. 하나 이상의 잉크 스트로크가 애플리케이션 쓰레드 (건 습식)를 처리 한 다음 복사 잉크 캔버스의 새로운 포인트로 InkStrokes 존재하는 경우는
private void Button_Click(object sender, RoutedEventArgs e)
{
InkDrawingAttributes attr = new InkDrawingAttributes();
attr.Color = Colors.Red;
attr.IgnorePressure = true;
attr.PenTip = PenTipShape.Circle;
attr.Size = new Size(4, 10);
attr.PenTipTransform = Matrix3x2.CreateRotation((float)(70 * Math.PI/180));
IReadOnlyList<InkStroke> InkStrokeList = MyInk.InkPresenter.StrokeContainer.GetStrokes();
foreach (InkStroke temp in InkStrokeList)
{
temp.DrawingAttributes = attr;
}
}
InkPresenter.StrokesCollected
의 이벤트가 발생한다. 다음 코드를 사용하면 동일한 잉크 캔버스의 다른 위치에 똑같은 획을 실시간으로 그릴 수 있습니다.
public MainPage()
{
this.InitializeComponent();
MyInk.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch;
MyInk.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected;
}
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args)
{
foreach (var temp in args.Strokes)
{
temp.Selected = true;
sender.StrokeContainer.CopySelectedToClipboard();
sender.StrokeContainer.PasteFromClipboard(new Point(100, 100));
}
}