I'm trying to solve the problem of changing the value ImageDescription for the Bitmap object. To add a description for the file. Searching the related topics, I have not found a solution.
My code:
public Bitmap ImageWithComment(Bitmap image)
{
string filePath = @"C:\1.jpg";
var data = Encoding.UTF8.GetBytes("my comment");
var propItem = image.PropertyItems.FirstOrDefault();
propItem.Type = 2;
propItem.Id = 40092;
propItem.Len = data.Length;
propItem.Value = data;
image.SetPropertyItem(propItem);
image.Save(filePath);
return image;
}
But image with new comment dont save in folder(( Please help me