Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WriteableBitmap Constructor (BitmapSource)

July 28, 2014

Initializes a new instance of the WriteableBitmap class using the provided BitmapSource.

Namespace:  System.Windows.Media.Imaging
Assembly:  System.Windows (in System.Windows.dll)

public WriteableBitmap(
	BitmapSource source
)

Parameters

source
Type: System.Windows.Media.Imaging.BitmapSource
The BitmapSource to use for initialization.

If source does not use a natively supported bitmap format, format conversions are applied for each frame update, which reduces performance.

If you use a BitmapImage as the source, remember that a BitmapImage constructed by a URL is initialized asynchronously. The default mode is DelayCreation, and in this case the image is possibly not being added to the visual tree and is thus not immediately requested for download. As such the image may be null and throws an exception in the constructor. It may be necessary to construct the image separately (using IgnoreImageCache), attach a handler for ImageOpened for the source, and only construct the WriteableBitmap once the ImageOpened event is handled.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft