本文整理汇总了VB.NET中System.Windows.Media.Imaging.PngBitmapDecoder.PngBitmapDecoder构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET PngBitmapDecoder构造函数的具体用法?VB.NET PngBitmapDecoder怎么用?VB.NET PngBitmapDecoder使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了PngBitmapDecoder构造函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: FileStream
' Open a Stream and decode a PNG image
Dim imageStreamSource As New FileStream("smiley.png", FileMode.Open, FileAccess.Read, FileShare.Read)
Dim decoder As New PngBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource As BitmapSource = decoder.Frames(0)
' Draw the Image
Dim myImage As New Image()
myImage.Source = bitmapSource
myImage.Stretch = Stretch.None
myImage.Margin = New Thickness(20)
示例2: Uri
' Open a Uri and decode a PNG image
Dim myUri As New Uri("smiley.png", UriKind.RelativeOrAbsolute)
Dim decoder2 As New PngBitmapDecoder(myUri, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource2 As BitmapSource = decoder2.Frames(0)
' Draw the Image
Dim myImage2 As New Image()
myImage2.Source = bitmapSource2
myImage2.Stretch = Stretch.None
myImage2.Margin = New Thickness(20)