WriteableBitmap class

Expand
1 out of 5 rated this helpful - Rate this topic

WriteableBitmap class

[This documentation is preliminary and is subject to change.]

Applies to: Metro style apps only

Provides a BitmapSource that can be written to and updated.

Inheritance

Object
  DependencyObject
    ImageSource
      BitmapSource
        WriteableBitmap

Syntax


public sealed class WriteableBitmap : BitmapSource

Attributes

ActivatableAttribute(Windows.UI.Xaml.Media.Imaging.IWriteableBitmapFactory, NTDDI_WIN8)
MarshalingBehaviorAttribute(Agile)
ThreadingAttribute(Both)
VersionAttribute(NTDDI_WIN8)
WebHostHiddenAttribute()

Members

The WriteableBitmap class has these types of members:

Constructors

The WriteableBitmap class has these constructors.

ConstructorDescription
WriteableBitmap Initializes a new instance of the WriteableBitmap class.

 

Methods

The WriteableBitmap 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)
Invalidate Requests a draw or redraw of the entire bitmap.
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. (Inherited from BitmapSource)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The WriteableBitmap class has these properties.

PropertyAccess typeDescription

Dispatcher

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

PixelBuffer

Read-onlyGets an access for the direct buffer where each pixel of the WriteableBitmap is written to.

PixelHeight

Read-onlyGets the height of the bitmap in pixels. (Inherited from BitmapSource)

PixelWidth

Read-onlyGets the width of the bitmap in pixels. (Inherited from BitmapSource)

 

Requirements

Minimum supported client

Windows 8 Release Preview

Minimum supported server

Windows Server 2012

Namespace

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

Metadata

Windows.winmd

See also

BitmapSource

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD
Sample
// create a bitmap WriteableBitmap writeableBitmap = new WriteableBitmap(100, 100); // get access to the pixels Stream pixelStream = writeableBitmap.PixelBuffer.AsStream(); byte[] row = new byte[100 * 4] // fill the row here with some values pixelStream.Write(row, 0, bytes); // write to the bitmap } // set it to a UI element Image1.Source = writeableBitmap;
10/6/2011