Closed Charltsing closed 2 months ago
Hi,
There's a small bug in extensions methods for boolean value, you can set it more directly like this:
false:
fx.SetValue((int)D2D1_STRAIGHTEN_PROP.D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE,
D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_BOOL,
BitConverter.GetBytes(0));
true:
fx.SetValue((int)D2D1_STRAIGHTEN_PROP.D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE,
D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_BOOL,
BitConverter.GetBytes(1));
Thanks for your reply. I am waiting for the bug be fixed in future versions.
It should be fixed by latest commit https://github.com/smourier/DirectN/commit/46512bb160e0dfe5917c12974bc1fd147dac7191
System.ComponentModel.Win32Exception HResult=0x80004005 Message=参数错误。 Source=DirectNStandard StackTrace: 在 DirectN.HRESULT.ThrowOnErrorExcept(IEnumerable`1 exceptedValues, Boolean throwOnError)
在 DirectN.HRESULT.ThrowOnError(Boolean throwOnError)
在 DirectN.ID2D1PropertiesExtensions.SetValue(ID2D1Properties properties, Int32 index, Object value)
在 DirectN.ID2D1PropertiesExtensions.SetValue(IComObject`1 properties, Int32 index, Object value)
DirectN 1.16.1
How should I set D2D1_STRAIGHTEN_PROP_MAINTAIN_SIZE parameters ?