Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

BitmapDecoder.Frames Property

Gets the content of an individual frame within a bitmap.

Namespace:  System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)
'Declaration
Public Overridable ReadOnly Property Frames As ReadOnlyCollection(Of BitmapFrame)

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection(Of BitmapFrame)
An instance of BitmapFrame. This property has no default value.

Only Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF) images support more than one frame.

Any BitmapFrame objects returned by this property are frozen.

The following code example demonstrates how to use a BitmapFrame as a BitmapSource.

' 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)

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.