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));
}
}