本文整理汇总了VB.NET中System.Windows.Media.Imaging.JpegBitmapDecoder.JpegBitmapDecoder构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET JpegBitmapDecoder构造函数的具体用法?VB.NET JpegBitmapDecoder怎么用?VB.NET JpegBitmapDecoder使用的例子?那么, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了JpegBitmapDecoder构造函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: FileStream
' Open a Stream and decode a JPEG image
Dim imageStreamSource As New FileStream("tulipfarm.jpg", FileMode.Open, FileAccess.Read, FileShare.Read)
Dim decoder As New JpegBitmapDecoder(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 JPEG image
Dim myUri As New Uri("tulipfarm.jpg", UriKind.RelativeOrAbsolute)
Dim decoder2 As New JpegBitmapDecoder(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)