InkCanvasでいくつかのインクストロークを描画して、ペンの色を変更したいと思っています。私は、CopyDefaultDrawingAttributesとUpdateDefaultDrawingAttributesを使って描いた追加のストロークの色を変更することができ、うまく動作します。しかし、StrokeContainerが既に存在するストロークの色を変更するにはどうすればよいですか?私は試しました:Windowsで既に描画されているInkStrokesの色を変更するには
foreach (InkStroke stroke in inkCanvas.InkPresenter.StrokeContainer.GetStrokes())
{
stroke.DrawingAttributes.Color = strokeColour;
};
このコードは例外なく実行されますが、stroke.DrawingAttributes.Colorは以前の色を表示します。
アイデア?あなたが直接、脳卒中のDrawingAttributesプロパティを設定することはできません
おかげで...
ロバート
[ここの例]に示すように、DrawingAttributesプロパティを更新しようとしましたか(https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.input.inking.inkdrawingattributes .color.aspx)? – Clemens