ColorContext Class
.NET Framework 4.5
Represents the International Color Consortium (ICC) or Image Color Management (ICM) color profile that is associated with a bitmap image.
Namespace: System.Windows.Media
Assembly: PresentationCore (in PresentationCore.dll)
The ColorContext type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ColorContext(PixelFormat) | Initializes a new instance of ColorContext with the standard color profile (sRGB or RGB ) that most closely matches the supplied PixelFormat. |
![]() | ColorContext(Uri) | Initializes a new instance of ColorContext with the International Color Consortium (ICC) or Image Color Management (ICM) color profile located at a given Uri. |
| Name | Description | |
|---|---|---|
![]() | ProfileUri | Gets a Uri that represents the location of a International Color Consortium (ICC) or Image Color Management (ICM) color profile. |
| Name | Description | |
|---|---|---|
![]() | Equals | Determines whether an Object is equal to an instance of ColorContext. (Overrides Object.Equals(Object).) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Gets the hash code for this instance of ColorContext. (Overrides Object.GetHashCode().) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | OpenProfileStream | Returns a readable Stream of raw color profile data. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | Equality | Operates on two instances of ColorContext to determine equality. |
![]() ![]() | Inequality | Operates on two instances of ColorContext to determine that they are not equal. |
The following code example demonstrates how to get the color profile that is associated with a bitmap image.
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();
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
