Voprosec Kryzh

Voprosec Kryzh

  • NA
  • 6
  • 2.6k

Change value of PropertyTagImageDescription (Bitmap/C#)

Jan 11 2013 6:27 PM
Good time! I'm trying to solve the problem of changing the value PropertyTagImageDescription (0x010E) for the Bitmap object. To add a description for the file. Searching the related topics, and has not found the solution. My use:

  Bitmap image = new Bitmap(Image.FromFile(fileName));
  var data = System.Text.Encoding.UTF8.GetBytes("My comment");
  PropertyItem propItem = image.GetPropertyItem(Convert.ToInt32(0x010E));
  propItem.Len = data.Length;
  propItem.Value = data;
  image.SetPropertyItem(propItem);


But there is an error : "In GDI + error occurred generic."

Help me understand! What I'm doing wrong?