# Region converts the Color Structure in. NET to the IRgbColor interface in ArcGIS Engine.
/// <Summary>
/// Convert the Color Structure in. NET to the IRgbColor interface in ArcGIS Engine.
/// </Summary>
/// <Param name = "color"> the System. Drawing. Color Structure in. NET indicates the ARGB color. </param>
/// <Returns> IRgbColor </returns>
Public static IRgbColor ConvertColorToIRgbColor (Color color)
{
IRgbColor pRgbColor = new RgbColorClass ();
PRgbColor. RGB = color. B * 65536 + color. G * 256 + color. R;
Return pRgbColor;
}
# Endregion
# Region converts the Color Structure in. NET to the IColor interface in ArcGIS Engine.
/// <Summary>
/// Convert the Color Structure in. NET to the IColor interface in ArcGIS Engine
/// </Summary>
/// <Param name = "color"> the System. Drawing. Color Structure in. NET indicates the ARGB color. </param>
/// <Returns> IColor </returns>
Public static IColor ConvertColorToIColor (Color color)
{
IColor pColor = new RgbColorClass ();
PColor. RGB = color. B * 65536 + color. G * 256 + color. R;
Return pColor;
}
# Endregion
# Region converts the IRgbColor interface in ArcGIS Engine to the Color structure in. NET.
/// <Summary>
/// Convert the IRgbColor interface in ArcGIS Engine to the Color structure in. NET.
/// </Summary>
/// <Param name = "pRgbColor"> IRgbColor </param>
/// <Returns> the System. Drawing. Color Structure in. NET indicates the ARGB Color. </returns>
Public static Color ConvertIRgbColorToColor (IRgbColor pRgbColor)
{
Return ColorTranslator. FromOle (pRgbColor. RGB );
}
# Endregion