ColorContext Class
TOC
Collapse the table of content
Expand the table of content

ColorContext Class

 

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)

System.Object
  System.Windows.Media.ColorContext

public class ColorContext

NameDescription
System_CAPS_pubmethodColorContext(PixelFormat)

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

System_CAPS_pubmethodColorContext(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.

NameDescription
System_CAPS_pubpropertyProfileUri

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

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether an Object is equal to an instance of ColorContext.(Overrides Object.Equals(Object).)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Gets the hash code for this instance of ColorContext. (Overrides Object.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodOpenProfileStream()

Returns a readable Stream of raw color profile data.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticEquality(ColorContext, ColorContext)

Operates on two instances of ColorContext to determine equality.

System_CAPS_puboperatorSystem_CAPS_staticInequality(ColorContext, ColorContext)

Operates on two instances of ColorContext to determine that they are not equal.

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
Available since 3.0

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

Return to top
Show:
© 2016 Microsoft