本文整理匯總了VB.NET中System.Windows.Media.Imaging.BitmapDecoder類的典型用法代碼示例。如果您正苦於以下問題:VB.NET BitmapDecoder類的具體用法?VB.NET BitmapDecoder怎麽用?VB.NET BitmapDecoder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了BitmapDecoder類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Uri
Dim uriBitmap As BitmapDecoder = BitmapDecoder.Create(New Uri("sampleImages/waterlilies.jpg", UriKind.Relative), BitmapCreateOptions.None, BitmapCacheOption.Default)
' Create an image element;
Dim uriImage As New Image()
uriImage.Width = 200
' Set image source.
uriImage.Source = uriBitmap.Frames(0)
示例2: FileStream
' Open a Stream and decode a TIFF image
Dim imageStreamSource As New FileStream("tulipfarm.tif", FileMode.Open, FileAccess.Read, FileShare.Read)
Dim decoder As New TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)
Dim bitmapSource As BitmapSource = decoder.Frames(0)
' Draw the Image
Dim myImage1 As New Image()
myImage1.Source = bitmapSource
myImage1.Stretch = Stretch.None
myImage1.Margin = New Thickness(20)