| | |
Color to uint and back
Please support our C# advertiser: Intel Parallel Studio Home
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); }
Similar Threads
- Alternate Style Changes Button Column back color in DATAGRID in vb.net (VB.NET)
- preprocessor uint to unsigned int (C)
- What's UINT & it's usage? (C++)
- set back color at run time (ASP.NET)
- linux/netbeans problem with default color covers set color of JTabbedPane (Java)
| Thread Tools | Search this Thread |
.net 2007 access ado.net algorithm array barchart bitmap box broadcast buttons c# camera check checkbox client color combobox control conversion cs4 csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event eventcloseformc# excel file form format forms function gdi+ httpwebrequest image index input install ip java label list listbox listener listview load mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox security serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update usercontrol validation view visual visualstudio webbrowser windows winforms wordautomation wpf xml



