ColorConvertedBitmap.BeginInit Method

Definition

Signals the start of the ColorConvertedBitmap initialization.

public void BeginInit ();

Implements

Exceptions

The ColorConvertedBitmap is currently being initialized. BeginInit() has already been called.

-or-

The ColorConvertedBitmap has already been initialized.

Examples

The following example demonstrates how to initialize a ColorConvertedBitmap with a set of properties by using the BeginInit and EndInit methods.

ColorConvertedBitmap myColorConvertedBitmap = new ColorConvertedBitmap();
myColorConvertedBitmap.BeginInit();
myColorConvertedBitmap.SourceColorContext = myBitmapSourceFrame2.ColorContexts[0];
myColorConvertedBitmap.Source = myBitmapSource2;
myColorConvertedBitmap.DestinationFormat = PixelFormats.Pbgra32;
myColorConvertedBitmap.DestinationColorContext = new ColorContext(PixelFormats.Bgra32);
myColorConvertedBitmap.EndInit();

Remarks

Property initialization must be done between BeginInit and EndInit calls. After the ColorConvertedBitmap has been initialized, property changes are ignored.

Applies to

제품 버전
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also