RGBQUAD Structure |
Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
[SerializableAttribute] public struct RGBQUAD : IComparable, IComparable<RGBQUAD>, IEquatable<RGBQUAD>
The RGBQUAD type exposes the following members.
Name | Description | |
---|---|---|
CompareTo(Object) |
Compares this instance with a specified Object.
| |
CompareTo(RGBQUAD) |
Compares this instance with a specified RGBQUAD object.
| |
Equals(Object) |
Tests whether the specified object is a RGBQUAD structure
and is equivalent to this RGBQUAD structure.
(Overrides ValueTypeEquals(Object).) | |
Equals(RGBQUAD) |
Tests whether the specified RGBQUAD structure is equivalent to this RGBQUAD structure.
| |
GetHashCode |
Returns a hash code for this RGBQUAD structure.
(Overrides ValueTypeGetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToColor |
Converts an array of RGBQUAD into an array of
Color.
| |
ToRGBQUAD |
Converts an array of Color into an array of
RGBQUAD.
| |
ToString |
Converts the numeric value of the RGBQUAD object
to its equivalent string representation.
(Overrides ValueTypeToString.) |
Name | Description | |
---|---|---|
Equality |
Tests whether two specified RGBQUAD structures are equivalent.
| |
(Color to RGBQUAD) |
Converts the value of a Color structure to a RGBQUAD structure.
| |
(UInt32 to RGBQUAD) |
Converts the value of an UInt32 structure to a RGBQUAD structure.
| |
(RGBQUAD to Color) |
Converts the value of a RGBQUAD structure to a Color structure.
| |
(RGBQUAD to UInt32) |
Converts the value of a RGBQUAD structure to an UInt32 structure.
| |
Inequality |
Tests whether two specified RGBQUAD structures are different.
|
Name | Description | |
---|---|---|
rgbBlue |
The blue color component.
| |
rgbGreen |
The green color component.
| |
rgbRed |
The red color component.
| |
rgbReserved |
The alpha color component.
| |
uintValue |
The color's value.
|
The RGBQUAD structure provides access to an underlying Win32 RGBQUAD structure. To determine the alpha, red, green or blue component of a color, use the rgbReserved, rgbRed, rgbGreen or rgbBlue fields, respectively.
For easy integration of the underlying structure into the .NET framework, the RGBQUAD 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 RGBQUAD structure and my be used in all situations which require an RGBQUAD type.
Each color component rgbReserved, rgbRed, rgbGreen or rgbBlue of RGBQUAD is translated into it's corresponding color component A, R, G or B of Color by an one-to-one manner and vice versa.
Conversion from System.Drawing.Color to RGBQUAD
RGBQUAD.component = Color.componentConversion from RGBQUAD to System.Drawing.Color
Color.component = RGBQUAD.componentThe same conversion is also applied when the Color property or the RGBQUAD(Color) constructor is invoked.
RGBQUAD rgbq; // Initialize the structure using a native .NET Color structure. rgbq = new RGBQUAD(Color.Indigo); // Initialize the structure using the implicit operator. rgbq = Color.DarkSeaGreen; // Convert the RGBQUAD instance into a native .NET Color // using its implicit operator. Color color = rgbq; // Using the structure's Color property for converting it // into a native .NET Color. Color another = rgbq.Color;