How to get and set propertyitems for an image

后端 未结 1 1694
青春惊慌失措
青春惊慌失措 2020-12-06 06:23

I\'m trying to understand these two methods of the Bitmap or Image. One being .SetPropertyItem() and the other being .GetPropertyItem().

I\

相关标签:
1条回答
  • 2020-12-06 06:52

    This is somewhat late, but it IS possible to create a new PropertyItem instance, without going through the pain of having to establish one from another source:

    using System.Runtime.Serialization;
    ...
    var newItem = (PropertyItem)FormatterServices.GetUninitializedObject(typeof(PropertyItem));
    

    This gets around the lack of constructor specified on PropertyItem (which seemed to prevent me from using System.Reflection)

    0 讨论(0)
提交回复
热议问题