Assembly: FreeImageNET (in FreeImageNET.dll)
Syntax
C# |
---|
[SerializableAttribute] public struct FIRGBA16 : IComparable, IComparable<FIRGBA16>, IEquatable<FIRGBA16> |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Structure FIRGBA16 _ Implements IComparable, IComparable(Of FIRGBA16), _ IEquatable(Of FIRGBA16) |
Visual C++ |
---|
[SerializableAttribute] public value class FIRGBA16 : IComparable, IComparable<FIRGBA16>, IEquatable<FIRGBA16> |
Remarks
The FIRGBA16 structure provides access to an underlying FreeImage FIRGBA16 structure. To determine the alpha, red, green or blue component of a color, use the alpha, red, green or blue fields, respectively.
For easy integration of the underlying structure into the .NET framework, the FIRGBA16 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 FIRGBA16 structure and my be used in all situations which require an FIRGBA16 type.
Each color component alpha, red, green or blue of FIRGBA16 is translated into it's corresponding color component A, R, G or B of Color by an 8 bit right shift and vice versa.
Conversion from System.Drawing.Color to FIRGBA16
FIRGBA16.component = Color.component << 8Conversion from FIRGBA16 to System.Drawing.Color
Color.component = FIRGBA16.component >> 8The same conversion is also applied when the Color property or the FIRGBA16(Color) constructor is invoked.
Examples
FIRGBA16 firgba16; // Initialize the structure using a native .NET Color structure. firgba16 = new FIRGBA16(Color.Indigo); // Initialize the structure using the implicit operator. firgba16 = Color.DarkSeaGreen; // Convert the FIRGBA16 instance into a native .NET Color // using its implicit operator. Color color = firgba16; // Using the structure's Color property for converting it // into a native .NET Color. Color another = firgba16.Color;