202 references to new
System.Drawing.Common.Tests (5)
DrawingTest.cs (1)
14BitmapData data = bitmap.LockBits(new Rectangle(default, bitmap.Size), ImageLockMode.ReadWrite, bitmap.PixelFormat);
mono\System.Drawing\GraphicsTests.cs (2)
2876Rectangle arcrect = new(baserect.Location, new Size(d, d)); 2918Rectangle arcrect = new(baserect.Location, new Size(d, d));
System\Drawing\GraphicsTests.cs (1)
252VerifyGraphics(graphics, new Rectangle(Point.Empty, image.Size));
System\Drawing\Imaging\Effects\EffectsTests.cs (1)
13graphics.FillRectangle(Brushes.White, new(default, bitmap.Size));
System.Windows.Forms (98)
System\Windows\Forms\Control.cs (2)
8740PrintToMetaFileRecursive(hDC, lParam, new Rectangle(Point.Empty, Size)); 8757Rectangle clientBounds = new(clientOffset, ClientSize);
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (4)
58Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(g, state)); 79Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(hdc, state, hwnd)); 123Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(g, state, hwnd)); 192Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(g, state));
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (4)
60Rectangle glyphBounds = new(glyphLocation, GetGlyphSize(hdc, state, hwnd)); 80glyphBounds = new Rectangle(glyphLocation, GetGlyphSize(hdc, state, hwnd)); 130glyphBounds = new Rectangle(glyphLocation, GetGlyphSize(hdc, state, hwnd)); 219glyphBounds = new Rectangle(glyphLocation, GetGlyphSize(hdc, state, hwnd));
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (1)
35_outerBorder = new Rectangle(_clientRect.Location, new Size(_clientRect.Width - 1, _clientRect.Height - 1));
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
18821Invalidate(new Rectangle(new Point(-pt.X, ColumnHeadersHeight), new Size(-step, ClientSize.Height))); 18831Invalidate(new Rectangle(new Point(ClientSize.Width - (pt.X - rect.Right) - step, ColumnHeadersHeight), 18838Invalidate(new Rectangle(new Point(0, -pt.Y), 18845Invalidate(new Rectangle(new Point(0, ColumnHeadersHeight),
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
1011cellBounds = new Rectangle(new Point(0, 0), GetSize(rowIndex));
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (1)
346return new Rectangle(GetTextLocation(cellBounds, sizeConstraint, flags, cellStyle), sizeConstraint);
System\Windows\Forms\Controls\Labels\Label.cs (1)
1357ControlPaint.PrintBorder(g, new Rectangle(Point.Empty, Size), BorderStyle, Border3DStyle.SunkenOuter);
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (3)
103_ => new Rectangle(point, new Size(itemBounds.Width, itemBounds.Height)), 112return new Rectangle( 131return new Rectangle(point, new Size(Math.Min(textWidth, itemBounds.Width), itemBounds.Height));
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (3)
3872Rectangle comparisonRect = new(point, s_onePixel); 4069item.SetBounds(new Rectangle(location, item.Size)); 4510cursorLocation = WindowsFormsUtils.ConstrainToScreenBounds(new Rectangle(cursorLocation, s_onePixel)).Location;
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (3)
995Rectangle suggestedScreenBounds = new(screenPoint, suggestedBounds.Size); 1006dropDownBounds = new Rectangle(parentClientPoint, suggestedBounds.Size); 1023Rectangle dropDownBounds = new(Point.Empty, GetSuggestedSize());
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (3)
141Rectangle ownerItemBounds = new(TranslatePoint(Point.Empty, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ScreenCoords), Size); 379Rectangle dropDownBounds = new(Point.Empty, DropDown.GetSuggestedSize()); 384Rectangle itemScreenBounds = new(TranslatePoint(Point.Empty, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ScreenCoords), Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (5)
421_textRectangle = new Rectangle(nextPoint, maxTextSize); 426_arrowRectangle = new Rectangle(nextPoint, maxArrowSize); 456_textRectangle.Y = LayoutUtils.VAlign(_textRectangle.Size, new Rectangle(Point.Empty, _maxItemSize), ContentAlignment.MiddleCenter).Y; 798UpScrollButton.SetBounds(new Rectangle(upLocation, upSize)); 804DownScrollButton.SetBounds(new Rectangle(downLocation, downSize));
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (8)
135Rectangle bounds = new(Point.Empty, e.Item.Size); 187Rectangle bounds = new(Point.Empty, menuItem.Size); 208DrawArrow(new ToolStripArrowRenderEventArgs(g, item, new Rectangle(Point.Empty, item.Size), arrowColor, ArrowDirection.Down)); 258Rectangle bounds = new(Point.Empty, e.ToolStrip.Size); 287Rectangle bounds = new(Point.Empty, e.ToolStrip.Size); 350Rectangle bounds = new(Point.Empty, e.Item.Size); 410Rectangle bounds = new(Point.Empty, e.Item.Size); 442Rectangle bounds = new(Point.Empty, e.Item.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (1)
2371ParentInternal?.Invalidate(new Rectangle(rectangleLocation, r.Size), true);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemAccessibleObject.cs (1)
304return new Rectangle(Owner.ParentInternal.PointToScreen(bounds.Location), bounds.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (1)
99Rectangle bounds = new(Point.Empty, _ownerItem.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (1)
711ControlPaint.DrawCaptionButton(g, new Rectangle(Point.Empty, image.Size), (CaptionButton)buttonToUse, ButtonState.Flat);
System\Windows\Forms\Controls\ToolStrips\ToolStripProfessionalLowResolutionRenderer.cs (1)
53Rectangle bounds = new(Point.Empty, e.ToolStrip.Size);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (25)
230Rectangle bounds = new(Point.Empty, item.Size); 248RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical); 266Rectangle bounds = new(Point.Empty, item.Size); 347Rectangle bounds = new(Point.Empty, item?.Size ?? Size.Empty); 417Rectangle bounds = new(Point.Empty, toolStrip.Size); 546Rectangle bounds = new(Point.Empty, item.Size); 769e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size), GraphicsUnit.Pixel); 846Rectangle bounds = new(Point.Empty, toolStrip.Size); 860Rectangle topLeftParentHorizontalPixels = new(topLeft, s_onePix); 861Rectangle bottomLeftParentHorizontalPixels = new(bottomLeft, new Size(2, 1)); 1108Rectangle bounds = new(Point.Empty, item.Size); 1134g.FillRectangle(brush, new Rectangle(Point.Empty, control.Size)); 1141Rectangle gradientBounds = new(Point.Empty, parent.Size); 1150g.FillRectangle(b, new Rectangle(Point.Empty, control.Size)); 1155Rectangle gradientBounds = new(Point.Empty, control.Size); 1174Rectangle bounds = new(Point.Empty, e.ToolStrip.Size); 1183Rectangle bounds = new(Point.Empty, e.ToolStrip.Size); 1195Rectangle bounds = new(Point.Empty, toolStripDropDown.Size); 1217Rectangle overflowBoundsFill = new(Point.Empty, e.Item.Size); 1338Rectangle bounds = new(Point.Empty, e.ToolStrip.Size); 1354Rectangle topLeftShadowRect = new(topLeft, s_onePix); 1358Rectangle topLeftShadowRect2 = new(topLeft, s_onePix); 1362Rectangle topRightShadowRect = new(topRight, s_onePix); 1392g.FillRectangle(brush, new Rectangle(gradientCopyPixel, s_onePix)); 1567Rectangle bounds = new(Point.Empty, item.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (2)
797e.Graphics.DrawImage(image, imageRect, new Rectangle(Point.Empty, imageRect.Size), GraphicsUnit.Pixel); 882TextRenderer.DrawText(textGraphics, text, textFont, new Rectangle(Point.Empty, textSize), textColor, textFormat);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderEventArgs.cs (1)
109Rectangle itemBounds = new(ToolStrip.PointToClient(ownerItem.TranslatePoint(Point.Empty, ToolStripPointType.ToolStripItemCoords, ToolStripPointType.ScreenCoords)), ownerItem.Size);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (2)
301Rectangle dropDownButtonBounds = new(Point.Empty, new Size(Math.Min(Width, DropDownButtonWidth), Height)); 307Rectangle splitButtonButtonBounds = new(Point.Empty, new Size(splitButtonButtonWidth, splitButtonButtonHeight));
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (2)
495Rectangle itemBounds = new(itemLocation, itemSize); 517item.SetBounds(new Rectangle(itemLocation, itemSize));
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemRenderer.cs (9)
279Rectangle bounds = new(Point.Empty, e.GripBounds.Size); 388vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size)); 394DrawArrow(new ToolStripArrowRenderEventArgs(g, item, new Rectangle(Point.Empty, item.Size), arrowColor, ArrowDirection.Down)); 421Rectangle bounds = new(Point.Empty, item.Size); 444Rectangle fillRect = new(Point.Empty, item.Size); 490RenderSeparatorInternal(e.Graphics, e.Item, new Rectangle(Point.Empty, e.Item.Size), e.Vertical); 530Rectangle bounds = new(Point.Empty, splitButton.Size); 656vsRenderer.DrawBackground(g, new Rectangle(Point.Empty, item.Size)); 668RenderSmall3DBorderInternal(g, new Rectangle(Point.Empty, item.Size), state, (item.RightToLeft == RightToLeft.Yes));
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
2830bounds = new Rectangle(textLoc, new Size(textSize.Width, bounds.Height));
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (1)
837Rectangle clientArea = new(Point.Empty, ClientSize);
System\Windows\Forms\Layout\DefaultLayout.cs (1)
99Rectangle newBounds = new(location, newSize);
System\Windows\Forms\Layout\FlowLayout.cs (2)
25Rectangle measureBounds = new(new Point(0, 0), proposedConstraints); 226Rectangle cellBounds = new(location, new Size(requiredSize.Width, rowBounds.Height));
System\Windows\Forms\Panels\Panel.cs (1)
234ControlPaint.PrintBorder(g, new Rectangle(Point.Empty, Size), BorderStyle, Border3DStyle.Sunken);
System\Windows\Forms\Rendering\ControlPaint.cs (2)
476Rectangle partOfImageToDraw = new(Point.Empty, imageRect.Size); 490Rectangle partOfImageToDraw = new(
System\Windows\Forms\Rendering\TextRenderer.cs (1)
287=> DrawTextInternal(dc, text, font, new Rectangle(pt, MaxSize), foreColor, backColor, flags);
System.Windows.Forms.Design (27)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (3)
279ActionPanel.Invalidate(new Rectangle(EditRegionLocation, EditRegionSize), false); 344Rectangle editorBounds = new(Point.Empty, EditRegionSize); 368Rectangle editorBounds = new(Point.Empty, EditRegionSize);
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
290Rectangle editRect = new(EditRegionRelativeLocation, EditRegionSize);
System\ComponentModel\Design\DesignerActionUI.cs (2)
616if ((new Rectangle(glyphCoord, new Size(currentGlyph.Bounds.Width, currentGlyph.Bounds.Height))).Contains(point)) 656Rectangle rectGlyph = new(glyphLocationScreenCoord, glyph.Bounds.Size);
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
302return new Rectangle(loc, c.Size);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (2)
689Rectangle currentBounds = new(_behaviorService.ControlToAdornerWindow(targetControl), targetControl.Size); 1087Rectangle dragBounds = new(_behaviorService.ControlToAdornerWindow(targetControl), targetControl.Size);
System\Windows\Forms\Design\Behavior\ToolStripPanelSelectionBehavior.cs (1)
119Rectangle translatedBounds = new(loc, parent.Size);
System\Windows\Forms\Design\ControlDesigner.cs (2)
2118Rectangle controlScreenBounds = new(parent.PointToScreen(Control.Location), Control.Size); 2119Rectangle clientAreaScreenBounds = new(Control.PointToScreen(Point.Empty), Control.ClientSize);
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
1863Rectangle rect = new(ClientRectangle.Location, ClientRectangle.Size);
System\Windows\Forms\Design\DesignerFrame.cs (1)
466Rectangle invalidateRect = new(overlayControl.PointToClient(screenRectangle.Location), screenRectangle.Size);
System\Windows\Forms\Design\DocumentDesigner.cs (1)
513Rectangle translatedBounds = new(loc, ((Control)Component).Size);
System\Windows\Forms\Design\ParentControlDesigner.cs (2)
1042Rectangle translatedBounds = new(loc, ((Control)Component).Size); 1238Rectangle bounds = new((Point)defaultValues["Location"], (Size)defaultValues["Size"]);
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (3)
970Rectangle bounds = new(startingPoint, Table.DisplayRectangle.Size); 1076Rectangle bounds = new(loc, Table.DisplayRectangle.Size); 1079Rectangle checkBounds = new(controlLoc, Control.ClientSize); // Can't use Control.Size since that will include any scrollbar
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1369Rectangle translatedBounds = new(loc, ((Control)Component).Size);
System\Windows\Forms\Design\ToolStripItemBehavior.cs (2)
991parentDesigner.DragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.X - (dragSize.Width / 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize); 1014ownerItemDesigner._dragBoxFromMouseDown = _dragBoxFromMouseDown = new Rectangle(new Point(mouseLoc.X - (dragSize.Width / 2), mouseLoc.Y - (dragSize.Height / 2)), dragSize);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (4)
1307Rectangle translatedBounds = new(loc, _miniToolStrip.Size); 1871Rectangle bounds = new(Point.Empty, e.ToolStrip.Size); 1886Rectangle bounds = new(Point.Empty, item.Size); 1982Rectangle bounds = new(Point.Empty, splitButton.Size);
System.Windows.Forms.Tests (68)
System\Windows\Forms\CheckBoxRendererTests.cs (1)
152? Validate.PolyPolygon16(new(new(bounds.X, bounds.Y), new Size(-1, -1)))
System\Windows\Forms\ControlTests.Methods.cs (18)
9783Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 9784Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 9786Assert.Equal(new Rectangle(Point.Empty, value), control.Bounds); 9793Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 9794Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 9796Assert.Equal(new Rectangle(Point.Empty, value), control.Bounds); 9817Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 9818Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 9826Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds); 9833Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 9834Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 9842Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds); 9865Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 9866Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 9874Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds); 9884Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 9885Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 9893Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds);
System\Windows\Forms\ControlTests.Properties.cs (18)
3338Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 3339Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 3341Assert.Equal(new Rectangle(Point.Empty, value), control.Bounds); 3348Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 3349Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 3351Assert.Equal(new Rectangle(Point.Empty, value), control.Bounds); 3382Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 3383Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 3391Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds); 3398Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 3399Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 3407Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds); 3445Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 3446Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 3454Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds); 3464Assert.Equal(new Rectangle(Point.Empty, value), control.ClientRectangle); 3465Assert.Equal(new Rectangle(Point.Empty, value), control.DisplayRectangle); 3473Assert.Equal(new Rectangle(Point.Empty, expectedSize), control.Bounds);
System\Windows\Forms\CursorTests.cs (4)
398Assert.Throws<ArgumentNullException>("graphics", () => cursor.Draw(null, new Rectangle(Point.Empty, cursor.Size))); 408Assert.Throws<ArgumentException>(() => cursor.Draw(graphics, new Rectangle(Point.Empty, cursor.Size))); 435Assert.Throws<ArgumentNullException>("graphics", () => cursor.DrawStretched(null, new Rectangle(Point.Empty, cursor.Size))); 445Assert.Throws<ArgumentException>(() => cursor.DrawStretched(graphics, new Rectangle(Point.Empty, cursor.Size)));
System\Windows\Forms\MonthCalendarTests.cs (12)
2527Assert.Equal(new Rectangle(Point.Empty, size), control.ClientRectangle); 2528Assert.Equal(new Rectangle(Point.Empty, size), control.DisplayRectangle); 2530Assert.Equal(new Rectangle(Point.Empty, size), control.Bounds); 2536Assert.Equal(new Rectangle(Point.Empty, size), control.ClientRectangle); 2537Assert.Equal(new Rectangle(Point.Empty, size), control.DisplayRectangle); 2539Assert.Equal(new Rectangle(Point.Empty, size), control.Bounds); 2560Assert.Equal(new Rectangle(Point.Empty, size), control.ClientRectangle); 2561Assert.Equal(new Rectangle(Point.Empty, size), control.DisplayRectangle); 2563Assert.Equal(new Rectangle(Point.Empty, size), control.Bounds); 2572Assert.Equal(new Rectangle(Point.Empty, size), control.ClientRectangle); 2573Assert.Equal(new Rectangle(Point.Empty, size), control.DisplayRectangle); 2575Assert.Equal(new Rectangle(Point.Empty, size), control.Bounds);
System\Windows\Forms\RadioButtonRendererTests.cs (1)
141? Validate.PolyPolygon16(new(new(bounds.X, bounds.Y), new Size(-1, -1)))
System\Windows\Forms\ScrollableControlTests.cs (2)
2419Assert.Equal(new Rectangle(expectedDisplayRectangleLocation, child.ExpectedSize.Size), child.Bounds); 2552public Rectangle ExpectedSize => new(new Point(0, 0), DefaultSize);
System\Windows\Forms\TextBoxRendererTests.cs (3)
44? Validate.Polygon16(new(new(1, 1), new(bounds.Width - 2, bounds.Height - 2))) 74? Validate.Polygon16(new(new(1, 1), new(bounds.Width - 2, bounds.Height - 2))) 110? Validate.Polygon16(new(new(1, 1), new(bounds.Width - 2, bounds.Height - 2)))
System\Windows\Forms\ToolStripGripRenderEventArgsTests.cs (1)
50Assert.Equal(new Rectangle(Point.Empty, toolStrip.Size), e.AffectedBounds);
System\Windows\Forms\ToolStripTests.cs (8)
6705Assert.Equal(new Rectangle(expectedItem1Location, oldBounds1.Size), item1.Bounds); 6706Assert.Equal(new Rectangle(expectedItem2Location, oldBounds2.Size), item2.Bounds); 6757Assert.Equal(new Rectangle(expectedItem1Location, oldBounds1.Size), item1.Bounds); 6758Assert.Equal(new Rectangle(expectedItem2Location, oldBounds2.Size), item2.Bounds); 7020Assert.Equal(new Rectangle(location, oldBounds.Size), item.Bounds); 7027Assert.Equal(new Rectangle(location, oldBounds.Size), item.Bounds); 7069Assert.Equal(new Rectangle(location, oldBounds.Size), item.Bounds); 7079Assert.Equal(new Rectangle(location, oldBounds.Size), item.Bounds);
System.Windows.Forms.UI.IntegrationTests (2)
DragDropTests.cs (1)
720_dragBoxFromMouseDown = new Rectangle(
Infra\ScreenshotService.cs (1)
75Rectangle bounds = new(Cursor.Position - (Size)cursor.HotSpot, cursor.Size);
WinFormsControlsTest (2)
ListViewTest.cs (1)
57Bounds = new Rectangle(new Point(0, 0), new Size(400, 200)),
MultipleControls.cs (1)
22Bounds = new Rectangle(new Point(0, 0), new Size(400, 200)),