private uint ColorToUInt(Color color)
{
      return (uint)((color.A << 24) | (color.R << 16) |
                    (color.G << 8)  | (color.B << 0));
}

private Color UIntToColor(uint color)
{
     byte a = (byte)(color >> 24);
     byte r = (byte)(color >> 16);
     byte g = (byte)(color >> 8);
     byte b = (byte)(color >> 0);
     return Color.FromArgb(a, r, g, b);
}
2
Contributors
1
Reply
3
Views
8 Years
Discussion Span
Last Post by subtercosm
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.