BitmapSource class

Applies to Windows and Windows Phone

Provides a source object for properties that use a bitmap-format image source.

Inheritance

Object
  DependencyObject
    ImageSource
      BitmapSource

Syntax


public class BitmapSource : ImageSource

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The BitmapSource class has these types of members:

Constructors

The BitmapSource class has these constructors.

ConstructorDescription
BitmapSource Provides base class initialization behavior for BitmapSource-derived classes.

 

Methods

The BitmapSource class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetSource Sets the source image for a BitmapSource by accessing a stream. Most callers should use SetSourceAsync instead.
SetSourceAsync Sets the source image for a BitmapSource by accessing a stream and processing the result asynchronously.
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The BitmapSource class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

PixelHeight

Read-onlyGets the height of the bitmap in pixels.

PixelHeightProperty

Read-onlyIdentifies the PixelHeight dependency property.

PixelWidth

Read-onlyGets the width of the bitmap in pixels.

PixelWidthProperty

Read-onlyIdentifies the PixelWidth dependency property.

 

Remarks

Important  

You don't typically use or create a BitmapSource type directly, that's why you don't see code examples on this page. It's more common to create a BitmapImage and use that as a value. For code examples and more info, see the reference page for BitmapImage.

ImageSource and BitmapSource are intermediate base classes for BitmapImage. For more info on how to create an image source to use for Image.Source and ImageBrush.ImageSource, see Quickstart: Image and ImageBrush and BitmapImage.

BitmapSource derived classes

BitmapSource is the parent class for BitmapImage and WriteableBitmap.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media.Imaging
Windows::UI::Xaml::Media::Imaging [C++]

Metadata

Windows.winmd

See also

ImageSource
Quickstart: Image and ImageBrush
BitmapImage

 

 

Show:
© 2014 Microsoft