Assembly: FreeImageNET (in FreeImageNET.dll)
Syntax
C# |
---|
[SerializableAttribute] public struct RGBQUAD : IComparable, IComparable<RGBQUAD>, IEquatable<RGBQUAD> |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Structure RGBQUAD _ Implements IComparable, IComparable(Of RGBQUAD), _ IEquatable(Of RGBQUAD) |
Visual C++ |
---|
[SerializableAttribute] public value class RGBQUAD : IComparable, IComparable<RGBQUAD>, IEquatable<RGBQUAD> |
Remarks
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.
Examples
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;