阅读并修改;“用户评论”;使用vb.net从JPEG文件

阅读并修改;“用户评论”;使用vb.net从JPEG文件,vb.net,image,exif,Vb.net,Image,Exif,我有特定类型的JPEG文件,其中包含“用户评论”属性中的信息 “用户评论”属性的ID为37510 我想做的就是: a) 以文本形式获取属性 b) 修改属性 c) 设置修改的属性 这是我想要的财产 'Load the Imgae from the file system. Dim image As Image = System.Drawing.Image.FromFile("Real_VRX_Image.jpg") 'The specific propertie item. Dim propIt

我有特定类型的JPEG文件,其中包含“用户评论”属性中的信息

“用户评论”属性的ID为37510

我想做的就是:

a) 以文本形式获取属性

b) 修改属性

c) 设置修改的属性

这是我想要的财产

'Load the Imgae from the file system.
Dim image As Image = System.Drawing.Image.FromFile("Real_VRX_Image.jpg")

'The specific propertie item.
Dim propItem As PropertyItem = image.GetPropertyItem(37510)
这不起作用,因为“用户注释”似乎是一个字节数组

'Display the Text of the "User Comment" (does not work...)
MessageBox.Show(propItem.Value.ToString)
我曾尝试使用这个函数,将字节数组转换为字符串,我可以编辑它,但它只是创建了垃圾

Public Function ByteArrayToString(ByRef Barr() As Byte) As String
Return Convert.ToBase64String(Barr)
End Function

Thx

MsgBox(System.Text.Encoding.Unicode.GetString(ProItem.Value))

请查看和的答案(其中有几个其他链接…)请描述您给出的答案,并避免发布一行