292 references to DpiHelper
System.Windows.Forms (292)
misc\DpiHelper.cs (2)
191
if ((
DpiHelper
.IsScalingRequired || enableDpiChangedMessageHandling) && IsDpiAwarenessValueSet())
481
Size deviceImageSize =
DpiHelper
.LogicalToDeviceUnits(logicalImage.Size, deviceDpi);
winforms\Managed\System\WinForms\Application.cs (3)
2608
using (
DpiHelper
.EnterDpiAwarenessScope(context)) {
2635
if (!
DpiHelper
.EnableDpiChangedHighDpiImprovements || CommonUnsafeNativeMethods.TryFindDpiAwarenessContextsEqual(context, DpiAwarenessContext.DPI_AWARENESS_CONTEXT_UNSPECIFIED)) {
3393
DpiHelper
.InitializeDpiHelperForWinforms();
winforms\Managed\System\WinForms\Button.cs (1)
333
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\ButtonInternal\ButtonStandardAdapter.cs (1)
72
if (!
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\ButtonInternal\CheckableControlBaseAdapter.cs (2)
83
if (
DpiHelper
.EnableDpiChangedMessageHandling
86
return control.deviceDpi /
DpiHelper
.LogicalDpi;
winforms\Managed\System\WinForms\ButtonInternal\CheckBoxStandardAdapter.cs (1)
119
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
winforms\Managed\System\WinForms\CheckBox.cs (3)
73
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
362
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
381
size.Height =
DpiHelper
.EnableDpiChangedHighDpiImprovements ? Math.Max(size.Height + 5, flatSystemStyleMinimumHeight) : size.Height + 5; // ensure minimum height to avoid truncation of check-box or text
winforms\Managed\System\WinForms\ComboBox.cs (2)
5927
if ((!isScalingInitialized &&
DpiHelper
.IsScalingRequired) ||
DpiHelper
.EnableDpiChangedMessageHandling) {
winforms\Managed\System\WinForms\ContainerControl.cs (2)
323
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
844
if (
DpiHelper
.EnableSinglePassScalingOfDpiForms && (AutoScaleMode == AutoScaleMode.Dpi)) {
winforms\Managed\System\WinForms\Control.cs (15)
492
DpiHelper
.InitializeDpiHelperForWinforms();
494
deviceDpi =
DpiHelper
.DeviceDpi;
2242
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
2245
return
DpiHelper
.DeviceDpi;
2583
Font newFont =
DpiHelper
.EnableDpiChangedHighDpiImprovements ?
7735
return
DpiHelper
.LogicalToDeviceUnits(value, DeviceDpi);
7745
return
DpiHelper
.LogicalToDeviceUnits(value, DeviceDpi);
7754
DpiHelper
.ScaleBitmapLogicalToDevice(ref logicalBitmap, DeviceDpi);
7758
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
8730
if (
DpiHelper
.EnableDpiChangedMessageHandling && !(typeof(Form).IsAssignableFrom(this.GetType()))) {
11409
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements && !GetStyle(ControlStyles.UserPaint) && (Properties.GetObject(PropFont) == null)) {
11556
if (
DpiHelper
.EnableAnchorLayoutHighDpiImprovements && (ParentInternal != null) && (ParentInternal.LayoutEngine == DefaultLayout.Instance)) {
13428
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
14327
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
14333
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
winforms\Managed\System\WinForms\Cursor.cs (2)
636
if (
DpiHelper
.IsScalingRequired) {
637
picSize =
DpiHelper
.LogicalToDeviceUnits(picSize);
winforms\Managed\System\WinForms\DataGridView.cs (1)
542
return
DpiHelper
.EnableDataGridViewControlHighDpiImprovements ? LogicalToDeviceUnits(value) : value;
winforms\Managed\System\WinForms\DataGridViewCell.cs (5)
84
if (
DpiHelper
.IsScalingRequired) {
85
iconsWidth = (byte)
DpiHelper
.LogicalToDeviceUnitsX(DATAGRIDVIEWCELL_iconsWidth);
86
iconsHeight = (byte)
DpiHelper
.LogicalToDeviceUnitsY(DATAGRIDVIEWCELL_iconsHeight);
1544
if (
DpiHelper
.IsScalingRequired) {
1545
Bitmap scaledBitmap =
DpiHelper
.CreateResizedBitmap(b, new Size(iconsWidth, iconsHeight));
winforms\Managed\System\WinForms\DataGridViewColumn.cs (2)
88
return
DpiHelper
.EnableDataGridViewControlHighDpiImprovements ?
DpiHelper
.LogicalToDeviceUnits(value) : value;
winforms\Managed\System\WinForms\DataGridViewColumnHeaderCell.cs (5)
47
if (
DpiHelper
.IsScalingRequired) {
48
sortGlyphSeparatorWidth = (byte)
DpiHelper
.LogicalToDeviceUnitsX(DATAGRIDVIEWCOLUMNHEADERCELL_sortGlyphSeparatorWidth);
49
sortGlyphHorizontalMargin = (byte)
DpiHelper
.LogicalToDeviceUnitsX(DATAGRIDVIEWCOLUMNHEADERCELL_sortGlyphHorizontalMargin);
50
sortGlyphWidth = (byte)
DpiHelper
.LogicalToDeviceUnitsX(DATAGRIDVIEWCOLUMNHEADERCELL_sortGlyphWidth);
55
sortGlyphHeight = (byte)
DpiHelper
.LogicalToDeviceUnitsY(DATAGRIDVIEWCOLUMNHEADERCELL_sortGlyphHeight);
winforms\Managed\System\WinForms\DataGridViewComboBoxCell.cs (5)
86
if (
DpiHelper
.IsScalingRequired)
88
offset2X =
DpiHelper
.LogicalToDeviceUnitsX(OFFSET_2PIXELS);
89
offset2Y =
DpiHelper
.LogicalToDeviceUnitsY(OFFSET_2PIXELS);
90
nonXPTriangleWidth = (byte)
DpiHelper
.LogicalToDeviceUnitsX(DATAGRIDVIEWCOMBOBOXCELL_nonXPTriangleWidth);
91
nonXPTriangleHeight = (byte)
DpiHelper
.LogicalToDeviceUnitsY(DATAGRIDVIEWCOMBOBOXCELL_nonXPTriangleHeight);
winforms\Managed\System\WinForms\DataGridViewRowHeaderCell.cs (2)
200
if (
DpiHelper
.IsScalingRequired && (b.Size.Width != iconsWidth || b.Size.Height != iconsHeight))
202
Bitmap scaledBitmap =
DpiHelper
.CreateResizedBitmap(b, desiredSize);
winforms\Managed\System\WinForms\Form.cs (5)
5113
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements && factor < 1) {
5119
Font =
DpiHelper
.EnableDpiChangedHighDpiImprovements ?
5131
ResumeAllLayout(this,
DpiHelper
.EnableDpiChangedHighDpiImprovements);
7624
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
7632
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
winforms\Managed\System\WinForms\ImageList.cs (3)
88
if (
DpiHelper
.IsScalingRequired) {
89
maxImageWidth =
DpiHelper
.LogicalToDeviceUnitsX(MAX_DIMENSION);
90
maxImageHeight =
DpiHelper
.LogicalToDeviceUnitsY(MAX_DIMENSION);
winforms\Managed\System\WinForms\Label.cs (1)
1752
if (!
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\Layout\DockAndAnchorLayout.cs (2)
583
if (
DpiHelper
.EnableAnchorLayoutHighDpiImprovements && (anchorInfo.Right - parentWidth > 0) && (oldAnchorInfo.Right < 0)) {
602
if (
DpiHelper
.EnableAnchorLayoutHighDpiImprovements && (anchorInfo.Bottom - parentHeight > 0) && (oldAnchorInfo.Bottom < 0)) {
winforms\Managed\System\WinForms\ListBox.cs (1)
177
if (
DpiHelper
.EnableCheckedListBoxHighDpiImprovements) {
winforms\Managed\System\WinForms\MenuStrip.cs (8)
80
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
81
DpiHelper
.LogicalToDeviceUnits(new Padding(2, 2, 0, 2), DeviceDpi) :
89
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
90
DpiHelper
.LogicalToDeviceUnits(new Size(200, 24), DeviceDpi) :
100
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
101
DpiHelper
.LogicalToDeviceUnits(new Padding(3, 2, 0, 2), DeviceDpi) :
104
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
105
DpiHelper
.LogicalToDeviceUnits(new Padding(6, 2, 0, 2), DeviceDpi) :
winforms\Managed\System\WinForms\MonthCalendar.cs (2)
254
if (
DpiHelper
.EnableMonthCalendarHighDpiImprovements) {
1957
bool updateRowsAndColumns = !
DpiHelper
.EnableMonthCalendarHighDpiImprovements || !IsCurrentlyBeingScaled;
winforms\Managed\System\WinForms\NativeWindow.cs (3)
108
private DpiAwarenessContext windowDpiAwarenessContext =
DpiHelper
.EnableDpiChangedHighDpiImprovements ?
597
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements && windowDpiAwarenessContext != DpiAwarenessContext.DPI_AWARENESS_CONTEXT_UNSPECIFIED) {
743
using (
DpiHelper
.EnterDpiAwarenessScope(this.windowDpiAwarenessContext)) {
winforms\Managed\System\WinForms\Printing\PrintControllerWithStatusDialog.cs (2)
301
if (
DpiHelper
.IsScalingRequired) {
302
this.ClientSize =
DpiHelper
.LogicalToDeviceUnits(clientSize);
winforms\Managed\System\WinForms\PropertyGrid.cs (10)
192
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
197
if (
DpiHelper
.IsScalingRequired) {
1654
if (
DpiHelper
.IsScalingRequired && (image.Size.Width != normalButtonSize.Width || image.Size.Height != normalButtonSize.Height)) {
1655
image =
DpiHelper
.CreateResizedBitmap(image, normalButtonSize);
2012
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
2099
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
2449
if (
DpiHelper
.IsScalingRequired) {
2481
largeBitmap =
DpiHelper
.CreateResizedBitmap(transparentBitmap, largeButtonSize);
4376
if (
DpiHelper
.IsScalingRequired) {
4857
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\PropertyGridInternal\DocComment.cs (6)
55
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
94
var padding =
DpiHelper
.EnableDpiChangedHighDpiImprovements ? LogicalToDeviceUnits(2) : 2;
96
return Math.Max(height + 2 * padding,
DpiHelper
.EnableDpiChangedHighDpiImprovements ? LogicalToDeviceUnits(CYDEF) : CYDEF);
122
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
156
Math.Max(0, size.Height - lineHeight - (
DpiHelper
.EnableDpiChangedHighDpiImprovements ? LogicalToDeviceUnits(1) : 1)),
172
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\PropertyGridInternal\DropDownButton.cs (1)
101
if (!
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\PropertyGridInternal\GridEntry.cs (2)
167
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
1984
PaintOutlineWithExplorerTreeStyle(g, r, (
DpiHelper
.EnableDpiChangedHighDpiImprovements && GridEntryHost!=null) ? this.GridEntryHost.HandleInternal: IntPtr.Zero);
winforms\Managed\System\WinForms\PropertyGridInternal\GridErrorDlg.cs (4)
80
if (
DpiHelper
.IsScalingRequired) {
81
DpiHelper
.ScaleBitmapLogicalToDevice(ref expandImage);
85
if (
DpiHelper
.IsScalingRequired) {
86
DpiHelper
.ScaleBitmapLogicalToDevice(ref collapseImage);
winforms\Managed\System\WinForms\PropertyGridInternal\GridToolTip.cs (1)
174
if (_positioned &&
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\PropertyGridInternal\PropertyDescriptorGridEntry.cs (3)
615
if (
DpiHelper
.IsScalingRequired) {
616
scaledImageSizeX =
DpiHelper
.LogicalToDeviceUnitsX(IMAGE_SIZE);
617
scaledImageSizeY =
DpiHelper
.LogicalToDeviceUnitsY(IMAGE_SIZE);
winforms\Managed\System\WinForms\PropertyGridInternal\PropertyGridView.cs (27)
180
if (
DpiHelper
.IsScalingRequired) {
181
paintWidth =
DpiHelper
.LogicalToDeviceUnitsX(PAINT_WIDTH);
182
paintIndent =
DpiHelper
.LogicalToDeviceUnitsX(PAINT_INDENT);
183
outlineSizeExplorerTreeStyle =
DpiHelper
.LogicalToDeviceUnitsX(OUTLINE_SIZE_EXPLORER_TREE_STYLE);
184
outlineSize =
DpiHelper
.LogicalToDeviceUnitsX(OUTLINE_SIZE);
185
maxListBoxHeight =
DpiHelper
.LogicalToDeviceUnitsY(MAX_LISTBOX_HEIGHT);
291
btnDropDown.Size =
DpiHelper
.EnableDpiChangedHighDpiImprovements ? new Size(SystemInformation.VerticalScrollBarArrowHeightForDpi(this.deviceDpi), RowHeight) : new Size(SystemInformation.VerticalScrollBarArrowHeight, RowHeight);
315
btnDialog.Size =
DpiHelper
.EnableDpiChangedHighDpiImprovements ? new Size(SystemInformation.VerticalScrollBarArrowHeightForDpi(this.deviceDpi), RowHeight) : new Size(SystemInformation.VerticalScrollBarArrowHeight, RowHeight);
330
if ((
DpiHelper
.IsScalingRequired ||
DpiHelper
.EnableDpiChangedHighDpiImprovements) && (b.Size.Width != iconsWidth || b.Size.Height != iconsHeight)) {
331
Bitmap scaledBitmap =
DpiHelper
.CreateResizedBitmap(b, desiredSize);
480
using (
DpiHelper
.EnterDpiAwarenessScope(DpiAwarenessContext.DPI_AWARENESS_CONTEXT_SYSTEM_AWARE)) {
1107
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
1111
else if (
DpiHelper
.IsScalingRequired ) {
1113
scaledIconWidth =
DpiHelper
.LogicalToDeviceUnitsX(width);
1114
scaledIconHeight =
DpiHelper
.LogicalToDeviceUnitsY(height);
1686
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
3797
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
4080
if (topLevelGridEntries != null &&
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
4426
Size sizeBtn =
DpiHelper
.EnableDpiChangedHighDpiImprovements? new Size(SystemInformation.VerticalScrollBarArrowHeightForDpi(this.deviceDpi), RowHeight):
5186
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
5194
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
5198
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
5410
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
6046
if(
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
6098
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
6120
if (!
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
winforms\Managed\System\WinForms\RadioButton.cs (3)
72
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
310
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {
324
size.Height =
DpiHelper
.EnableDpiChangedHighDpiImprovements ? Math.Max(size.Height + 5, flatSystemStyleMinimumHeight) : size.Height + 5; // ensure minimum height to avoid truncation of RadioButton circle or text
winforms\Managed\System\WinForms\ScrollBar.cs (1)
220
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements && ScaleScrollBarForDpiChange) {
winforms\Managed\System\WinForms\SystemInformation.cs (5)
187
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
213
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
254
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
374
return GetMenuFontHelper((uint)dpi,
DpiHelper
.EnableDpiChangedMessageHandling);
520
if (
DpiHelper
.EnableDpiChangedMessageHandling) {
winforms\Managed\System\WinForms\ThreadExceptionDialog.cs (4)
101
if (
DpiHelper
.EnableThreadExceptionDialogHighDpiImprovements) {
237
if (
DpiHelper
.EnableThreadExceptionDialogHighDpiImprovements && (Label.UseCompatibleTextRenderingDefault == false)) {
324
if (
DpiHelper
.EnableThreadExceptionDialogHighDpiImprovements) {
356
if (
DpiHelper
.EnableThreadExceptionDialogHighDpiImprovements) {
winforms\Managed\System\WinForms\ToolStrip.cs (22)
180
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
183
iconWidth =
DpiHelper
.LogicalToDeviceUnits(ICON_DIMENSION, DeviceDpi);
184
iconHeight =
DpiHelper
.LogicalToDeviceUnits(ICON_DIMENSION, DeviceDpi);
185
insertionBeamWidth =
DpiHelper
.LogicalToDeviceUnits(INSERTION_BEAM_WIDTH, DeviceDpi);
186
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding, DeviceDpi);
187
scaledDefaultGripMargin =
DpiHelper
.LogicalToDeviceUnits(defaultGripMargin, DeviceDpi);
189
else if (
DpiHelper
.IsScalingRequired) {
190
iconWidth =
DpiHelper
.LogicalToDeviceUnitsX(ICON_DIMENSION);
191
iconHeight =
DpiHelper
.LogicalToDeviceUnitsY(ICON_DIMENSION);
192
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
193
insertionBeamWidth =
DpiHelper
.LogicalToDeviceUnitsX(INSERTION_BEAM_WIDTH);
194
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding);
195
scaledDefaultGripMargin =
DpiHelper
.LogicalToDeviceUnits(defaultGripMargin);
653
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
654
DpiHelper
.LogicalToDeviceUnits(new Size(100, 25), DeviceDpi) :
3302
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
3896
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
3922
iconWidth =
DpiHelper
.LogicalToDeviceUnits(ICON_DIMENSION, newDpi);
3923
iconHeight =
DpiHelper
.LogicalToDeviceUnits(ICON_DIMENSION, newDpi);
3924
insertionBeamWidth =
DpiHelper
.LogicalToDeviceUnits(INSERTION_BEAM_WIDTH, newDpi);
3925
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding, newDpi);
3926
scaledDefaultGripMargin =
DpiHelper
.LogicalToDeviceUnits(defaultGripMargin, newDpi);
winforms\Managed\System\WinForms\ToolStripButton.cs (3)
194
standardButtonWidth =
DpiHelper
.LogicalToDeviceUnits(STANDARD_BUTTON_WIDTH, DeviceDpi);
220
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
221
standardButtonWidth =
DpiHelper
.LogicalToDeviceUnitsX(STANDARD_BUTTON_WIDTH);
winforms\Managed\System\WinForms\ToolStripComboBox.cs (3)
49
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
50
scaledPadding =
DpiHelper
.LogicalToDeviceUnits(padding);
51
scaledDropDownPadding =
DpiHelper
.LogicalToDeviceUnits(dropDownPadding);
winforms\Managed\System\WinForms\ToolStripDropDown.cs (3)
104
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
105
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding);
1686
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding, newDpi);
winforms\Managed\System\WinForms\ToolStripDropDownButton.cs (6)
241
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements)
243
dropDownArrowSize =
DpiHelper
.LogicalToDeviceUnits(dropDownArrowSizeUnscaled, ownerItem.DeviceDpi);
244
scaledDropDownArrowPadding =
DpiHelper
.LogicalToDeviceUnits(dropDownArrowPadding, ownerItem.DeviceDpi);
246
else if (
DpiHelper
.IsScalingRequired) {
249
dropDownArrowSize =
DpiHelper
.LogicalToDeviceUnits(dropDownArrowSizeUnscaled);
250
scaledDropDownArrowPadding =
DpiHelper
.LogicalToDeviceUnits(dropDownArrowPadding);
winforms\Managed\System\WinForms\ToolStripDropDownMenu.cs (18)
81
if (
DpiHelper
.IsScalingRequired) {
82
scaledDefaultImageSize =
DpiHelper
.LogicalToDeviceUnits(DefaultImageSize);
83
scaledDefaultImageMarginWidth =
DpiHelper
.LogicalToDeviceUnitsX(DefaultImageMarginWidth) + 1; // 1px for border
84
scaledDefaultImageAndCheckMarginWidth =
DpiHelper
.LogicalToDeviceUnitsX(DefaultImageAndCheckMarginWidth) + 1; // 1px for border
86
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
87
scaledImagePadding =
DpiHelper
.LogicalToDeviceUnits(ImagePadding);
88
scaledTextPadding =
DpiHelper
.LogicalToDeviceUnits(TextPadding);
89
scaledCheckPadding =
DpiHelper
.LogicalToDeviceUnits(CheckPadding);
90
scaledArrowPadding =
DpiHelper
.LogicalToDeviceUnits(ArrowPadding);
91
scaledArrowSize =
DpiHelper
.LogicalToDeviceUnitsX(ArrowSize);
608
scaledDefaultImageSize =
DpiHelper
.LogicalToDeviceUnits(DefaultImageSize, newDpi);
609
scaledDefaultImageMarginWidth =
DpiHelper
.LogicalToDeviceUnits(DefaultImageMarginWidth, newDpi) + 1; // 1px for border
610
scaledDefaultImageAndCheckMarginWidth =
DpiHelper
.LogicalToDeviceUnits(DefaultImageAndCheckMarginWidth, newDpi) + 1; // 1px for border
612
scaledImagePadding =
DpiHelper
.LogicalToDeviceUnits(ImagePadding, newDpi);
613
scaledTextPadding =
DpiHelper
.LogicalToDeviceUnits(TextPadding, newDpi);
614
scaledCheckPadding =
DpiHelper
.LogicalToDeviceUnits(CheckPadding, newDpi);
615
scaledArrowPadding =
DpiHelper
.LogicalToDeviceUnits(ArrowPadding, newDpi);
616
scaledArrowSize =
DpiHelper
.LogicalToDeviceUnits(ArrowSize, newDpi);
winforms\Managed\System\WinForms\ToolStripGrip.cs (7)
36
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
37
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding);
38
scaledGripThickness =
DpiHelper
.LogicalToDeviceUnitsX(gripThicknessDefault);
39
scaledGripThicknessVisualStylesEnabled =
DpiHelper
.LogicalToDeviceUnitsX(gripThicknessVisualStylesEnabled);
243
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding, newDpi);
244
scaledGripThickness =
DpiHelper
.LogicalToDeviceUnits(gripThicknessDefault, newDpi);
245
scaledGripThicknessVisualStylesEnabled =
DpiHelper
.LogicalToDeviceUnits(gripThicknessVisualStylesEnabled, newDpi);
winforms\Managed\System\WinForms\ToolStripItem.cs (9)
177
private int deviceDpi =
DpiHelper
.DeviceDpi;
186
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
187
scaledDefaultMargin =
DpiHelper
.LogicalToDeviceUnits(defaultMargin);
188
scaledDefaultStatusStripMargin =
DpiHelper
.LogicalToDeviceUnits(defaultStatusStripMargin);
732
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
733
DpiHelper
.LogicalToDeviceUnits(new Size(23, 23), DeviceDpi) :
1073
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
3516
scaledDefaultMargin =
DpiHelper
.LogicalToDeviceUnits(defaultMargin, deviceDpi);
3517
scaledDefaultStatusStripMargin =
DpiHelper
.LogicalToDeviceUnits(defaultStatusStripMargin, deviceDpi);
winforms\Managed\System\WinForms\ToolStripManager.cs (4)
48
private static int currentDpi =
DpiHelper
.DeviceDpi;
68
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
273
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
1275
using (
DpiHelper
.EnterDpiAwarenessScope(context)) {
winforms\Managed\System\WinForms\ToolStripMenuItem.cs (17)
179
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
180
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding);
181
scaledDefaultDropDownPadding =
DpiHelper
.LogicalToDeviceUnits(defaultDropDownPadding);
182
scaledCheckMarkBitmapSize =
DpiHelper
.LogicalToDeviceUnits(checkMarkBitmapSize);
197
return
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements ?
198
DpiHelper
.LogicalToDeviceUnits(new Size(32, 19), DeviceDpi) :
281
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
289
if (
DpiHelper
.IsScalingRequired) {
290
DpiHelper
.ScaleBitmapLogicalToDevice(ref indeterminateCheckedBmp);
300
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
308
if (
DpiHelper
.IsScalingRequired) {
309
DpiHelper
.ScaleBitmapLogicalToDevice(ref checkedBmp);
339
if (
DpiHelper
.IsScalingRequired && (b.Size.Width != desiredIconSize.Width || b.Size.Height != desiredIconSize.Height))
341
Bitmap scaledBitmap =
DpiHelper
.CreateResizedBitmap(b, desiredIconSize);
679
scaledDefaultPadding =
DpiHelper
.LogicalToDeviceUnits(defaultPadding, value);
680
scaledDefaultDropDownPadding =
DpiHelper
.LogicalToDeviceUnits(defaultDropDownPadding, value);
681
scaledCheckMarkBitmapSize =
DpiHelper
.LogicalToDeviceUnits(checkMarkBitmapSize, value);
winforms\Managed\System\WinForms\ToolStripOverflowButton.cs (3)
37
if (
DpiHelper
.IsScalingRequired)
39
maxWidth =
DpiHelper
.LogicalToDeviceUnitsX(MAX_WIDTH);
40
maxHeight =
DpiHelper
.LogicalToDeviceUnitsY(MAX_HEIGHT);
winforms\Managed\System\WinForms\ToolStripPanel.cs (2)
78
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
79
scaledRowMargin =
DpiHelper
.LogicalToDeviceUnits(rowMargin);
winforms\Managed\System\WinForms\ToolStripPanelRow.cs (2)
68
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
69
minAllowedWidth =
DpiHelper
.LogicalToDeviceUnitsX(MINALLOWEDWIDTH);
winforms\Managed\System\WinForms\ToolStripProfessionalRenderer.cs (18)
909
Rectangle bounds =
DpiHelper
.IsScalingRequired ? new Rectangle(e.ImageRectangle.Left-2, (e.Item.Height - e.ImageRectangle.Height )/2- 1, e.ImageRectangle.Width+4, e.ImageRectangle.Height +2) :
1402
if (
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
1405
overflowButtonWidth =
DpiHelper
.LogicalToDeviceUnits(OVERFLOW_BUTTON_WIDTH, currentDeviceDpi);
1406
overflowArrowWidth =
DpiHelper
.LogicalToDeviceUnits(OVERFLOW_ARROW_WIDTH, currentDeviceDpi);
1407
overflowArrowHeight =
DpiHelper
.LogicalToDeviceUnits(OVERFLOW_ARROW_HEIGHT, currentDeviceDpi);
1408
overflowArrowOffsetY =
DpiHelper
.LogicalToDeviceUnits(OVERFLOW_ARROW_OFFSETY, currentDeviceDpi);
1410
gripPadding =
DpiHelper
.LogicalToDeviceUnits(GRIP_PADDING, currentDeviceDpi);
1411
iconWellGradientWidth =
DpiHelper
.LogicalToDeviceUnits(ICON_WELL_GRADIENT_WIDTH, currentDeviceDpi);
1412
int scaledSize =
DpiHelper
.LogicalToDeviceUnits(DROP_DOWN_MENU_ITEM_PAINT_PADDING_SIZE, currentDeviceDpi);
1422
if (
DpiHelper
.IsScalingRequired) {
1424
overflowButtonWidth =
DpiHelper
.LogicalToDeviceUnitsX(OVERFLOW_BUTTON_WIDTH);
1425
overflowArrowWidth =
DpiHelper
.LogicalToDeviceUnitsX(OVERFLOW_ARROW_WIDTH);
1426
overflowArrowHeight =
DpiHelper
.LogicalToDeviceUnitsY(OVERFLOW_ARROW_HEIGHT);
1427
overflowArrowOffsetY =
DpiHelper
.LogicalToDeviceUnitsY(OVERFLOW_ARROW_OFFSETY);
1429
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
1430
gripPadding =
DpiHelper
.LogicalToDeviceUnitsY(GRIP_PADDING);
1431
iconWellGradientWidth =
DpiHelper
.LogicalToDeviceUnitsX(ICON_WELL_GRADIENT_WIDTH);
1432
int scaledSize =
DpiHelper
.LogicalToDeviceUnitsX(DROP_DOWN_MENU_ITEM_PAINT_PADDING_SIZE);
winforms\Managed\System\WinForms\ToolStripProgressBar.cs (3)
36
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
37
scaledDefaultMargin =
DpiHelper
.LogicalToDeviceUnits(defaultMargin);
38
scaledDefaultStatusStripMargin =
DpiHelper
.LogicalToDeviceUnits(defaultStatusStripMargin);
winforms\Managed\System\WinForms\ToolStripRenderer.cs (12)
51
internal int previousDeviceDpi =
DpiHelper
.DeviceDpi;
683
if (
DpiHelper
.IsScalingRequired) {
684
Offset2X =
DpiHelper
.LogicalToDeviceUnitsX(OFFSET_2PIXELS);
685
Offset2Y =
DpiHelper
.LogicalToDeviceUnitsY(OFFSET_2PIXELS);
686
offset4X =
DpiHelper
.LogicalToDeviceUnitsX(OFFSET_4PIXELS);
687
offset4Y =
DpiHelper
.LogicalToDeviceUnitsY(OFFSET_4PIXELS);
694
Offset2X =
DpiHelper
.LogicalToDeviceUnits(OFFSET_2PIXELS, dpi);
695
Offset2Y =
DpiHelper
.LogicalToDeviceUnits(OFFSET_2PIXELS, dpi);
696
offset4X =
DpiHelper
.LogicalToDeviceUnits(OFFSET_4PIXELS, dpi);
697
offset4Y =
DpiHelper
.LogicalToDeviceUnits(OFFSET_4PIXELS, dpi);
718
if (e.Item?.DeviceDpi != previousDeviceDpi &&
DpiHelper
.EnableToolStripPerMonitorV2HighDpiImprovements) {
727
int horizontalOffset =
DpiHelper
.EnableToolStripHighDpiImprovements ? offset4X - Offset2X : Offset2X;
winforms\Managed\System\WinForms\ToolStripSplitButton.cs (2)
280
if (
DpiHelper
.IsScalingRequired) {
281
scaledDropDownButtonWidth =
DpiHelper
.LogicalToDeviceUnitsX(DEFAULT_DROPDOWN_WIDTH);
winforms\Managed\System\WinForms\ToolStripStatusLabel.cs (2)
158
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
159
scaledDefaultMargin =
DpiHelper
.LogicalToDeviceUnits(defaultMargin);
winforms\Managed\System\WinForms\ToolStripTextBox.cs (3)
43
if (
DpiHelper
.EnableToolStripHighDpiImprovements) {
44
scaledDefaultMargin =
DpiHelper
.LogicalToDeviceUnits(defaultMargin);
45
scaledDefaultDropDownMargin =
DpiHelper
.LogicalToDeviceUnits(defaultDropDownMargin);
winforms\Managed\System\WinForms\TreeView.cs (2)
106
if (
DpiHelper
.IsScalingRequired) {
107
scaledStateImageSize =
DpiHelper
.LogicalToDeviceUnits(new Size(16, 16));
winforms\Managed\System\WinForms\UpDownBase.cs (1)
88
if (
DpiHelper
.IsScalingRequired) {
winforms\Managed\System\WinForms\VisualStyles\VisualStyleRenderer.cs (1)
755
if (
DpiHelper
.EnableDpiChangedMessageHandling && (IntPtr.Zero != hWnd)) {
winforms\Managed\System\WinForms\VScrollBar.cs (1)
59
if (
DpiHelper
.EnableDpiChangedHighDpiImprovements) {