Click here to Skip to main content
15,885,537 members

Сhange value of PropertyTagImageDescription (Bitmap/C#)

Revision 2
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 image = new Bitmap(fileName);
    var data = System.Text.Encoding.UTF8.GetBytes("My comment");
    PropertyItem propItem = image.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: , ,