ColorContext Constructor (PixelFormat)
Collapse the table of content
Expand the table of content

ColorContext Constructor (PixelFormat)

 

Initializes a new instance of ColorContext with the standard color profile (sRGB or RGB ) that most closely matches the supplied PixelFormat.

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

[SecurityCriticalAttribute]
public ColorContext(
	PixelFormat pixelFormat
)

Parameters

pixelFormat
Type: System.Windows.Media.PixelFormat

The PixelFormat from which the ColorContext is derived.

The following code example demonstrates how to construct a new instance of ColorContext.

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();

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft