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\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));
Windows\Win32\Graphics\GdiPlus\GpBitmapExtensions.cs (1)
43(uint)ColorTranslator.ToWin32(background)).ThrowIfFailed();
System.Windows.Forms (29)
System\Windows\Forms\Control.cs (3)
725backBrush = PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(color)); 5921PInvoke.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 5922PInvoke.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(BackColor));
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
2061PInvoke.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(ForeColor)); 2062PInvoke.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)
2877nmcd->clrText = ColorTranslator.ToWin32(_odCacheForeColor); 2881nmcd->clrText = ColorTranslator.ToWin32(riFore); 2892if (nmcd->clrText == ColorTranslator.ToWin32(SystemColors.HotTrack)) 2932nmcd->clrTextBk = ColorTranslator.ToWin32(_odCacheBackColor); 2936nmcd->clrTextBk = 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 = PInvoke.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 171PInvoke.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlDark)); 232(COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Control), 233(COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 266COLORREF oldTextColor = PInvoke.SetTextColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 267COLORREF oldBackColor = PInvoke.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)PInvoke.CreatePen(PEN_STYLE.PS_DOT, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1809FrameStyle.Thick => (HGDIOBJ)PInvoke.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 2, (COLORREF)(uint)ColorTranslator.ToWin32(backColor)).Value, 1817PInvoke.SetBkColor(desktopDC, (COLORREF)(uint)ColorTranslator.ToWin32(graphicsColor)); 1833using ObjectScope pen = new(PInvoke.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(backColor))); 2048using ObjectScope brush = new(PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(backColor)));
System.Windows.Forms.Design (9)
System\Windows\Forms\Design\DesignerUtils.cs (8)
28PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 30PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 32PInvoke.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 34PInvoke.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 173s_grabHandleFillBrushPrimary = PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window)); 176s_grabHandleFillBrush = PInvoke.CreateSolidBrush((COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 179s_grabHandlePenPrimary = PInvoke.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.ControlText)); 182s_grabHandlePen = PInvoke.CreatePen(PEN_STYLE.PS_SOLID, cWidth: 1, (COLORREF)(uint)ColorTranslator.ToWin32(SystemColors.Window));
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
444PInvoke.SetBkColor(dc, (COLORREF)(uint)ColorTranslator.ToWin32(graphicsColor));
System.Windows.Forms.Primitives (3)
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);
Windows\Win32\Foundation\COLORREF.cs (1)
22public static implicit operator COLORREF(Color color) => new((uint)ColorTranslator.ToWin32(color));