Take the 2-minute tour ×

anybody know if it is possible to write meta data to a BitMap class in C#? The constraint is that only .NET 2.0 can be used.

I read about the PropertyItem class in C# but it does not explain how to set the property; it only showed how to get the property.


share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Yes, it's possible. Here's an example in VB.

  Dim prop As PropertyItem
  prop = img.PropertyItems(0) ' no constructor   
  prop.Id = tagNo
  prop.Len = nBytes
  prop.Type = dataType
  prop.Value = bs   

(img is an Image. bs is an array of byte.) You do have to save the image into a new file, because .net apparently reads the exif data from the old file instead of keeping it in memory.

share|improve this answer
add comment

Your Answer


