By default I would have said ToARGB(), but according to MSDN these
numbers are atually BGR:
http://msdn2.microsoft.com/en-us/lib...tomcolors.aspx
The following puts a color both in and out - that do?
Color color = Color.Tomato;
int bgr = (color.B << 16) | (color.G << 8) | color.R;
using(ColorDialog dlg = new ColorDialog()) {
dlg.CustomColors = new int[] { bgr };
dlg.ShowDialog();
foreach (int outBgr in dlg.CustomColors) {
// store these in some form
int r = outBgr & 0xFF,
g = (outBgr & 0xFF00) >> 8,
b = (outBgr & 0xFF0000) >> 16;
Trace.WriteLine(string.Format("R:{0}, G:{1}, B:{2}",
r, g, b));
}
}
Marc