Uređivanje

Dijeli putem


WriteableBitmap Constructors

Definition

Initializes a new instance of the WriteableBitmap class.

Overloads

WriteableBitmap(BitmapSource)

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

WriteableBitmap(Int32, Int32, Double, Double, PixelFormat, BitmapPalette)

Initializes a new instance of the WriteableBitmap class with the specified parameters.

WriteableBitmap(BitmapSource)

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

public:
 WriteableBitmap(System::Windows::Media::Imaging::BitmapSource ^ source);
[System.Security.SecurityCritical]
public WriteableBitmap (System.Windows.Media.Imaging.BitmapSource source);
public WriteableBitmap (System.Windows.Media.Imaging.BitmapSource source);
[<System.Security.SecurityCritical>]
new System.Windows.Media.Imaging.WriteableBitmap : System.Windows.Media.Imaging.BitmapSource -> System.Windows.Media.Imaging.WriteableBitmap
new System.Windows.Media.Imaging.WriteableBitmap : System.Windows.Media.Imaging.BitmapSource -> System.Windows.Media.Imaging.WriteableBitmap
Public Sub New (source As BitmapSource)

Parameters

source
BitmapSource

The BitmapSource to use for initialization.

Attributes

Remarks

The WriteableBitmap(Int32, Int32, Double, Double, PixelFormat, BitmapPalette) constructor is preferred over using this constructor.

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

Applies to

WriteableBitmap(Int32, Int32, Double, Double, PixelFormat, BitmapPalette)

Initializes a new instance of the WriteableBitmap class with the specified parameters.

public:
 WriteableBitmap(int pixelWidth, int pixelHeight, double dpiX, double dpiY, System::Windows::Media::PixelFormat pixelFormat, System::Windows::Media::Imaging::BitmapPalette ^ palette);
[System.Security.SecurityCritical]
public WriteableBitmap (int pixelWidth, int pixelHeight, double dpiX, double dpiY, System.Windows.Media.PixelFormat pixelFormat, System.Windows.Media.Imaging.BitmapPalette palette);
public WriteableBitmap (int pixelWidth, int pixelHeight, double dpiX, double dpiY, System.Windows.Media.PixelFormat pixelFormat, System.Windows.Media.Imaging.BitmapPalette palette);
[<System.Security.SecurityCritical>]
new System.Windows.Media.Imaging.WriteableBitmap : int * int * double * double * System.Windows.Media.PixelFormat * System.Windows.Media.Imaging.BitmapPalette -> System.Windows.Media.Imaging.WriteableBitmap
new System.Windows.Media.Imaging.WriteableBitmap : int * int * double * double * System.Windows.Media.PixelFormat * System.Windows.Media.Imaging.BitmapPalette -> System.Windows.Media.Imaging.WriteableBitmap
Public Sub New (pixelWidth As Integer, pixelHeight As Integer, dpiX As Double, dpiY As Double, pixelFormat As PixelFormat, palette As BitmapPalette)

Parameters

pixelWidth
Int32

The desired width of the bitmap.

pixelHeight
Int32

The desired height of the bitmap.

dpiX
Double

The horizontal dots per inch (dpi) of the bitmap.

dpiY
Double

The vertical dots per inch (dpi) of the bitmap.

pixelFormat
PixelFormat

The PixelFormat of the bitmap.

palette
BitmapPalette

The BitmapPalette of the bitmap.

Attributes

Remarks

The preferred values for pixelFormat are Bgr32 and Pbgra32. These formats are natively supported and do not require a format conversion. Other pixelFormat values require a format conversion for each frame update, which reduces performance.

Applies to