Assembly: FreeImageNET (in FreeImageNET.dll)
Syntax
C# |
---|
[SerializableAttribute] public struct RGBTRIPLE : IComparable, IComparable<RGBTRIPLE>, IEquatable<RGBTRIPLE> |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Structure RGBTRIPLE _ Implements IComparable, IComparable(Of RGBTRIPLE), _ IEquatable(Of RGBTRIPLE) |
Visual C++ |
---|
[SerializableAttribute] public value class RGBTRIPLE : IComparable, IComparable<RGBTRIPLE>, IEquatable<RGBTRIPLE> |
Remarks
The RGBTRIPLE structure provides access to an underlying Win32 RGBTRIPLE structure. To determine the red, green or blue component of a color, use the rgbtRed, rgbtGreen or rgbtBlue fields, respectively.
For easy integration of the underlying structure into the .NET framework, the RGBTRIPLE structure implements implicit conversion operators to convert the represented color to and from the Color type. This makes the Color type a real replacement for the RGBTRIPLE structure and my be used in all situations which require an RGBTRIPLE type.
Each of the color components rgbtRed, rgbtGreen or rgbtBlue of RGBTRIPLE is translated into it's corresponding color component R, G or B of Color by an one-to-one manner and vice versa. When converting from Color into RGBTRIPLE, the color's alpha value is ignored and assumed to be 255 when converting from RGBTRIPLE into Color, creating a fully opaque color.
Conversion from System.Drawing.Color to RGBTRIPLE
RGBTRIPLE.component = Color.componentConversion from RGBTRIPLE to System.Drawing.Color
Color.component = RGBTRIPLE.componentThe same conversion is also applied when the Color property or the RGBTRIPLE(Color) constructor is invoked.
Examples
RGBTRIPLE rgbt; // Initialize the structure using a native .NET Color structure. rgbt = new RGBTRIPLE(Color.Indigo); // Initialize the structure using the implicit operator. rgbt = Color.DarkSeaGreen; // Convert the RGBTRIPLE instance into a native .NET Color // using its implicit operator. Color color = rgbt; // Using the structure's Color property for converting it // into a native .NET Color. Color another = rgbt.Color;