Closed RoccoZero closed 1 year ago
Version 2.1.0 fixes this issue. Thanks for reporting
I keep getting this error on Version 2.1.0
23:33:12 | ERROR | System.InvalidCastException: Unable to cast object of type 'Win32.Graphics.Direct2D.AffineTransform2DProperties' to type 'System.UInt32'.
at Win32.Graphics.Direct2D.ID2D1PropertiesExtensions.SetValue[TD2D1Properties,T,U](TD2D1Properties& self, U index, T* value) in D:\a\Vortice.Win32\Vortice.Win32\src\Vortice.Win32.Graphics.Direct2D\ID2D1Properties.cs:line 257
Call SetEnumValue
i can't use SetEnumValue I need SetValue because that's where I send the matrix I get an error if I use SetValue and the first parameter index is Enum
Then use SetValue and pass the Matrix3x2, without the &translation, just use translation
this working SetValue((uint)AffineTransform2DProperties.TransformMatrix, translation);
but why can’t I remove enum cast to uint? It worked before (uint)AffineTransform2DProperties.TransformMatrix
C++ looks like this, no need to cast
C# enums are different from C++ one
I think that you have some kind of problem here, I don’t see any difference here this SetEnumValue is not needed
Send PR, thanks!
I found another mistake, you don't use ": uint"
because of this, this code of yours is useless for the enum type it gives this error System.InvalidCastException: Unable to cast object of type 'Win32.Graphics.Direct2D.AffineTransform2DProperties' to type 'System.UInt32'.
this is how it was on the old version
07:35:41 | ERROR | System.InvalidCastException: Unable to cast object of type 'Win32.Graphics.Direct2D.AffineTransform2DProperties' to type 'System.UInt32'. at Win32.Graphics.Direct2D.ID2D1PropertiesExtensions.SetValue[TD2D1Properties,T,U](TD2D1Properties& self, U index, T* value) in D:\a\Vortice.Win32\Vortice.Win32\src\Vortice.Win32.Graphics.Direct2D\ID2D1Properties.cs:line 59