本文整理汇总了VB.NET中System.Drawing.Imaging.PropertyItem类的典型用法代码示例。如果您正苦于以下问题:VB.NET PropertyItem类的具体用法?VB.NET PropertyItem怎么用?VB.NET PropertyItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PropertyItem类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: ExtractMetaData
Private Sub ExtractMetaData(ByVal e As PaintEventArgs)
Try
'Create an Image object.
Dim theImage As Image = New Bitmap("c:\fakePhoto.jpg")
'Get the PropertyItems property from image.
Dim propItems As PropertyItem() = theImage.PropertyItems
'Set up the display.
Dim font As New font("Arial", 10)
Dim blackBrush As New SolidBrush(Color.Black)
Dim X As Integer = 0
Dim Y As Integer = 0
'For each PropertyItem in the array, display the id, type, and length.
Dim count As Integer = 0
Dim propItem As PropertyItem
For Each propItem In propItems
e.Graphics.DrawString("Property Item " + count.ToString(), _
font, blackBrush, X, Y)
Y += font.Height
e.Graphics.DrawString(" iD: 0x" & propItem.Id.ToString("x"), _
font, blackBrush, X, Y)
Y += font.Height
e.Graphics.DrawString(" type: " & propItem.Type.ToString(), _
font, blackBrush, X, Y)
Y += font.Height
e.Graphics.DrawString(" length: " & propItem.Len.ToString() & _
" bytes", font, blackBrush, X, Y)
Y += font.Height
count += 1
Next propItem
font.Dispose()
Catch ex As ArgumentException
MessageBox.Show("There was an error. Make sure the path to the image file is valid.")
End Try
End Sub