Click here to Skip to main content
15,896,201 members

Сhange value of PropertyTagImageDescription (Bitmap/C#)

Revision 1
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:

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


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

Help me understand! What I'm doing wrong?
Posted 11-Jan-13 12:25pm by Voprosec.
Tags: , ,