我在windows 10 build 14939中使用InkCanvas
和InkToolBar
來捕獲用戶的墨跡筆劃。InkCanvas上的重做功能
我願做一個自定義按鈕,撤消但是/重做我有麻煩創建如下:
private static InkStroke CreateStroke(List<InkPoint> redoInkPoints) {
var strokeBuilder = new InkStrokeBuilder();
Matrix3x2 matr = new Matrix3x2();
return strokeBuilder.CreateStrokeFromInkPoints(redoInkPoints, matr);
}
但是視覺工作室有關
「Argment類型的MATR變量投訴'System.Numerics.Matrix3x2'不可分配給參數類型'Windows.Foundation.Numerics.Matrix3x2'
即使我沒有在我的代碼中引用windows.foundation.numerics.matrix3x2的任何地方。
任何人對我如何使用CreateStrokeFromInkPoints
有任何想法或例子?
謝謝你的建議,但是有變化時,Visual Studio仍投訴MATR變量'段類型'System.Numerics.Matrix3x2'不能分配給參數類型'Windows.Foundation.Numerics.Matrix3x2'。我現在很困惑,因爲Matrix3x2應該是System.Numerics(在Visual Studio中建議)或Windows.Foundation.Numerics(從上面的msdn鏈接建議)的類型。 – Jennifer
@Jennifer你有沒有嘗試過我的代碼與一個新的空白應用程序項目?它適合我身邊。如果您仍然有錯誤,那麼它可能不在您發佈的代碼中。如果您可以分享可以重現問題的[mcve],可能會有所幫助。 –
@Jennifer Windows.Foundation.Numerics.Matrix3x2是基本的Windows運行時類型。如果您使用C#進行開發,那麼您應該使用'System.Numerics.Matrix3x2'。 –