PropertyItem
Encapsulates a metadata property to be included in an image file. Not inheritable.
using System.Runtime.CompilerServices;
using Windows.Win32.Graphics.GdiPlus;
namespace System.Drawing.Imaging
{
[NullableContext(2)]
[Nullable(0)]
public sealed class PropertyItem
{
public int Id { get; set; }
public int Len { get; set; }
public short Type { get; set; }
public byte[] Value { get; set; }
internal PropertyItem()
{
}
[NullableContext(0)]
[return: Nullable(1)]
internal unsafe static PropertyItem FromNative(global::Windows.Win32.Graphics.GdiPlus.PropertyItem* native)
{
if (native == null)
throw new ArgumentNullException("native");
return new PropertyItem {
Id = native->id,
Len = native->length,
Type = (short)native->type,
Value = new Span<byte>(native->value, (int)native->length).ToArray()
};
}
}
}