C# 从墨水点创建笔划墨水画布
我想从墨水点列表中创建一个笔划,我的问题是该方法的第二个参数,矩阵3x2。 这段代码我有一个例外:C# 从墨水点创建笔划墨水画布,c#,windows,win-universal-app,stroke,inkcanvas,C#,Windows,Win Universal App,Stroke,Inkcanvas,我想从墨水点列表中创建一个笔划,我的问题是该方法的第二个参数,矩阵3x2。 这段代码我有一个例外: List<InkPoint> inkpoints = new List<InkPoint>(); InkStrokeBuilder ink = new InkStrokeBuilder(); System.Numerics.Matrix3x2 matr= new System.Numerics.Matr
List<InkPoint> inkpoints = new List<InkPoint>();
InkStrokeBuilder ink = new InkStrokeBuilder();
System.Numerics.Matrix3x2 matr= new System.Numerics.Matrix3x2();
InkStroke stroke = ink.CreateStrokeFromInkPoints(inkpoints,matr);
inkCanvas.InkPresenter.StrokeContainer.AddStroke(stroke);
List inkpoints=new List();
InkStrokeBuilder墨水=新的InkStrokeBuilder();
System.Numerics.Matrix3x2 matr=新的System.Numerics.Matrix3x2();
InkStroke笔划=ink.CreateStrokeFromInkPoints(inkpoints,matr);
inkCanvas.InkPresenter.StrokeContainer.AddStroke(stroke);
例外情况:
List<InkPoint> inkpoints = new List<InkPoint>();
InkStrokeBuilder ink = new InkStrokeBuilder();
System.Numerics.Matrix3x2 matr= new System.Numerics.Matrix3x2();
InkStroke stroke = ink.CreateStrokeFromInkPoints(inkpoints,matr);
inkCanvas.InkPresenter.StrokeContainer.AddStroke(stroke);
$exception{“值不在预期范围内。”}System.ArgumentException不确定指定零矩阵的原因。它会把你所有的点压缩成一个奇点。您可能需要标识矩阵:
System.Numerics.Matrix3x2.identity
。非常感谢,您是对的!!!