46 references to ToWin32
System.Drawing.Common.Tests (1)
System\Drawing\ColorTranslatorTests.cs (1)
56Assert.Equal(expected, ColorTranslator.ToWin32(color));
System.Drawing.Primitives (1)
System\Drawing\ColorTranslator.cs (1)
129return ToWin32(c);
System.Private.Windows.Core (3)
Windows\Win32\Foundation\COLORREF.cs (1)
22public static implicit operator COLORREF(Color color) => new((uint)ColorTranslator.ToWin32(color));
Windows\Win32\Foundation\LPARAM.cs (1)
26public static explicit operator LPARAM(Color value) => (LPARAM)ColorTranslator.ToWin32(value);
Windows\Win32\Foundation\WPARAM.cs (1)
31public static explicit operator WPARAM(Color value) => new((nuint)ColorTranslator.ToWin32(value));
System.Private.Windows.GdiPlus (1)
Windows\Win32\Graphics\GdiPlus\GpBitmapExtensions.cs (1)
45(uint)ColorTranslator.ToWin32(background)).ThrowIfFailed();
System.Windows.Forms (29)
System\Windows\Forms\Control.cs (3)
703backBrush = PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(color)); 5782PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 5783PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(BackColor));
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
2004PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 2005PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(BackColor));
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
1361(int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(foreBrush.Color)).Value);
System\Windows\Forms\Controls\ListView\ListView.cs (5)
2843? (COLORREF)ColorTranslator.ToWin32(_odCacheForeColor) 2844: (COLORREF)ColorTranslator.ToWin32(riFore); 2854if (nmcd->clrText == ColorTranslator.ToWin32(SystemColors.HotTrack)) 2886? (COLORREF)ColorTranslator.ToWin32(_odCacheBackColor) 2887: (COLORREF)ColorTranslator.ToWin32(riBack);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (4)
862cf.crTextColor = ColorTranslator.ToWin32(value); 921cf2.crBackColor = ColorTranslator.ToWin32(value); 2117&& ColorTranslator.ToWin32(value) == cf.crTextColor) 2124cf.crTextColor = ColorTranslator.ToWin32(value);
System\Windows\Forms\Controls\TreeView\TreeView.cs (2)
2787nmtvcd->clrText = ColorTranslator.ToWin32(riFore); 2792nmtvcd->clrTextBk = ColorTranslator.ToWin32(riBack);
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (6)
160savedColor = PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 171PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlDark)); 232(COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Control), 233(COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 266COLORREF oldTextColor = PInvokeCore.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 267COLORREF oldBackColor = PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Control));
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
101return !_usingDefaultIndirectColor ? _color : ColorTranslator.FromWin32(ColorTranslator.ToWin32(_color));
System\Windows\Forms\Rendering\ControlPaint.cs (5)
1808FrameStyle.Dashed => (HGDIOBJ)PInvokeCore.CreatePen(PEN_STYLE.PS_DOT, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1809FrameStyle.Thick => (HGDIOBJ)PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 2, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1817PInvokeCore.SetBkColor(desktopDC, (COLORREF)(uint)ColorTranslator.ToWin32(graphicsColor)); 1833using ObjectScope pen = new(PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor))); 2048using ObjectScope brush = new(PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(backColor)));
System.Windows.Forms.Design (9)
System\Windows\Forms\Design\DesignerUtils.cs (8)
28PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 30PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 32PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 34PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 173s_grabHandleFillBrushPrimary = PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 176s_grabHandleFillBrush = PInvokeCore.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 179s_grabHandlePenPrimary = PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 182s_grabHandlePen = PInvokeCore.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window));
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
444PInvokeCore.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(graphicsColor));
System.Windows.Forms.Primitives (2)
System\Drawing\ColorExtensions.cs (1)
8public static int ToWin32(this Color color) => ColorTranslator.ToWin32(color);
System\Windows\Forms\DeviceContextExtensions.cs (1)
119Color newColor = ColorTranslator.FromWin32((int)PInvoke.GetNearestColor(hdc, (COLORREF)(uint)ColorTranslator.ToWin32(color)).Value);