Export (0) Print
Expand All

ColorContext Class

Represents the International Color Consortium (ICC) or Image Color Management (ICM) color profile that is associated with a bitmap image.

System.Object
  System.Windows.Media.ColorContext

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

public class ColorContext

The ColorContext type exposes the following members.

  NameDescription
Public methodColorContext(PixelFormat)Initializes a new instance of ColorContext with the standard color profile (sRGB or RGB ) that most closely matches the supplied PixelFormat.
Public methodColorContext(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.
Top

  NameDescription
Public propertyProfileUriGets a Uri that represents the location of a International Color Consortium (ICC) or Image Color Management (ICM) color profile.
Top

  NameDescription
Public methodEqualsDetermines whether an Object is equal to an instance of ColorContext. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeGets the hash code for this instance of ColorContext. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOpenProfileStreamReturns a readable Stream of raw color profile data.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public operatorStatic memberEqualityOperates on two instances of ColorContext to determine equality.
Public operatorStatic memberInequalityOperates on two instances of ColorContext to determine that they are not equal.
Top

The supported standard color spaces are sRGB, ScRGB, RGB, CMYK, Gray, Multichannel, and unknown.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, 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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft