RGBTRIPLE Structure |
Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
[SerializableAttribute] public struct RGBTRIPLE : IComparable, IComparable<RGBTRIPLE>, IEquatable<RGBTRIPLE>
The RGBTRIPLE type exposes the following members.
Name | Description | |
---|---|---|
CompareTo(Object) |
Compares this instance with a specified Object.
| |
CompareTo(RGBTRIPLE) |
Compares this instance with a specified RGBTRIPLE object.
| |
Equals(Object) |
Tests whether the specified object is a RGBTRIPLE structure
and is equivalent to this RGBTRIPLE structure.
(Overrides ValueTypeEquals(Object).) | |
Equals(RGBTRIPLE) |
Tests whether the specified RGBTRIPLE structure is equivalent to this
RGBTRIPLE structure.
| |
GetHashCode |
Returns a hash code for this RGBTRIPLE structure.
(Overrides ValueTypeGetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString |
Converts the numeric value of the RGBTRIPLE object
to its equivalent string representation.
(Overrides ValueTypeToString.) |
Name | Description | |
---|---|---|
Equality |
Tests whether two specified RGBTRIPLE structures are equivalent.
| |
(Color to RGBTRIPLE) |
Converts the value of a Color structure to a RGBTRIPLE structure.
| |
(UInt32 to RGBTRIPLE) |
Converts the value of an UInt32 structure to a RGBTRIPLE structure.
| |
(RGBTRIPLE to Color) |
Converts the value of a RGBTRIPLE structure to a Color structure.
| |
(RGBTRIPLE to UInt32) |
Converts the value of a RGBTRIPLE structure to an UInt32 structure.
| |
Inequality |
Tests whether two specified RGBTRIPLE structures are different.
|
Name | Description | |
---|---|---|
rgbtBlue |
The blue color component.
| |
rgbtGreen |
The green color component.
| |
rgbtRed |
The red color component.
|
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.
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;