// Windows values are in BGR format and without alpha // so we force it to opaque (or everything will be transparent) and reverse B and R static uint GetSysColor(GetSysColorIndex index) { uint bgr = GDIPlus.Win32GetSysColor(index); return(0xFF000000 | (bgr & 0xFF) << 16 | (bgr & 0xFF00) | (bgr >> 16)); }
// Windows values are in BGR format and without alpha // so we force it to opaque (or everything will be transparent) and reverse B and R static uint GetSysColor (GetSysColorIndex index) { uint bgr = GDIPlus.Win32GetSysColor (index); return 0xFF000000 | (bgr & 0xFF) << 16 | (bgr & 0xFF00) | (bgr >> 16); }
public static extern uint Win32GetSysColor (GetSysColorIndex index);
public static extern uint Win32GetSysColor(GetSysColorIndex index);
private void Compare (KnownColor kc, GetSysColorIndex index) { // we get BGR than needs to be converted into ARGB Color sc = ColorTranslator.FromWin32 ((int)GDIPlus.Win32GetSysColor (index)); Assert.AreEqual (Color.FromKnownColor (kc).ToArgb (), sc.ToArgb (), kc.ToString ()); }
// Windows values are in BGR format and without alpha // so we force it to opaque (or everything will be transparent) and reverse B and R static uint GetSysColor(GetSysColorIndex index) { uint bgr = SafeNativeMethods.Gdip.Win32GetSysColor(index); return(0xFF000000 | (bgr & 0xFF) << 16 | (bgr & 0xFF00) | (bgr >> 16)); }