'[分享]感谢【大红袍】的帮助 分享获取图像信息及
'图片文件Exif信息详细说明 发帖心情 Post By:2015/12/16 2:12:00 [只看该作者]
Dim img As Image = Image.FromFile("D:\IMG_20200522_155639.jpg")
Dim pt As PropertyItem() = img.PropertyItems
For i As Integer = 0 To pt.Length - 1
Dim p As PropertyItem = pt(i)
Select Case pt(i).Id
Case &H132
Dim s As String = System.Text.Encoding.ASCII.GetString(p.value)
Output.Show("修改时间: " & s)
Output.Show("")
Case &H9003
Dim s As String = System.Text.Encoding.ASCII.GetString(p.value)
Output.Show("拍摄时间: " & s)
Output.Show("")
Case &H110
Dim s As String = System.Text.Encoding.ASCII.GetString(p.value)
Output.Show("相机型号: " & s)
Output.Show("")
Case &H10F
Dim s As String = System.Text.Encoding.ASCII.GetString(p.value)
Output.Show("制造商: " & s)
Output.Show("")
Case &H131
Dim s As String = System.Text.Encoding.ASCII.GetString(p.value)
Output.Show("修改软件: " & s)
Output.Show("")
End Select
Next
Dim 图像高度 As Integer = img.Height.ToString()
Output.Show("图像高度: " & 图像高度 & " DPI" )
Dim 图像宽度 As Integer = img.Width.ToString()
Output.Show("图像宽度: " & 图像宽度 & " DPI" )