System.Drawing.Rectangle.Inflate(System.Drawing.Size)

Here are the examples of the csharp api class System.Drawing.Rectangle.Inflate(System.Drawing.Size) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

34 Examples 7

1. Example

Project: Krypton
Source File: ViewDrawRibbonGroupDialogButton.cs
public override void RenderBefore(RenderContext context) 
        {
            IPaletteBack palette/n ..... /n //View Source file for more details /n }

2. Example

Project: Krypton
Source File: ViewDrawRibbonQATExtraButton.cs
public override void RenderBefore(RenderContext context) 
        {
            // Update the enable/n ..... /n //View Source file for more details /n }

3. Example

Project: splat
Source File: Rectangle.cs
public void Inflate(int width, int height)
        {
            Inflate(new Size(width, height));
        }

4. Example

Project: tinvedit
Source File: ColoredProgressBar.cs
public Rectangle GetProgressRect()
        {
            var Result = new Rectangle(0, 0, Width, Height);
            var size = new Size(-1, -1);
            Result.Inflate(size);
            Result.Width = (int) (Result.Width * ((double) Value / Maximum));
            if (Result.Width == 0) Result.Width = 1;

            return Result;
        }

5. Example

Project: Krypton
Source File: ViewBuilderItemBase.cs
private void OnCheckButtonDragRect(object sender, ButtonDragRectangleEventArgs e)
        {
            // Cast incoming reference to the actual button view
            INavCheckItem reorderItem = (INavCheckItem)sender;

            e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
            Rectangle dragRect = Rectangle.Union(e.DragRect, _layoutBarViewport.ClientRectangle);
            dragRect.Inflate(new Size(10, 10));
            e.DragRect = dragRect;
        }

6. Example

Project: Krypton
Source File: ViewBuilderOutlookBase.cs
private void OnCheckButtonDragRect(object sender, ButtonDragRectangleEventArgs e)
        {
            // Cast incoming reference to the actual check button view
            ViewDrawNavOutlookStack reorderItem = (ViewDrawNavOutlookStack)sender;

            e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
            Rectangle dragRect = Rectangle.Union(e.DragRect, _viewLayout.ClientRectangle);
            dragRect.Inflate(new Size(10, 10));
            e.DragRect = dragRect;

            // Constrain by the position of the separator (depends on the orientation)
            if (SeparatorOrientation == Orientation.Horizontal)
            {
                int reduce = _viewSeparator.ClientRectangle.Bottom - e.DragRect.Y;
                e.DragRect = new Rectangle(e.DragRect.X, e.DragRect.Y + reduce, e.DragRect.Width, e.DragRect.Height - reduce);
            }
            else
            {
                int reduce = _viewSeparator.ClientRectangle.Right - e.DragRect.X;
                e.DragRect = new Rectangle(e.DragRect.X + reduce, e.DragRect.Y, e.DragRect.Width - reduce, e.DragRect.Height);
            }
        }

7. Example

Project: Krypton
Source File: ViewBuilderStackCheckButtonBase.cs
private void OnCheckButtonDragRect(object sender, ButtonDragRectangleEventArgs e)
        {
            // Cast incoming reference to the actual check button view
            ViewDrawNavCheckButtonStack reorderItem = (ViewDrawNavCheckButtonStack)sender;

            e.PreDragOffset = (Navigator.AllowPageReorder && reorderItem.Page.AreFlagsSet(KryptonPageFlags.AllowPageReorder));
            Rectangle dragRect = Rectangle.Union(e.DragRect, _viewScrollViewport.ClientRectangle);
            dragRect.Inflate(new Size(15, 15));
            e.DragRect = dragRect;
        }

8. Example

Project: StackBuilder
Source File: WindowSettings.cs
private bool IsOnScreen(Point location)
        {
            foreach (var screen in Screen.AllScreens)
            {
                Rectangle recScreen = screen.WorkingArea;
                recScreen.Inflate(new Size(1,1));
                if (recScreen.Contains(location))
                {
                    return true;
                }
            }
            return false;
        }

9. Example

Project: Krypton
Source File: DragViewController.cs
public virtual bool MouseDown(Control c, Point pt, MouseButtons button)
		{
            // Only interested in left mouse pressing down
            if (button == MouseButtons.Left)
            {
                // Capturing mouse input
                c.Capture = true;
                _captured = true;
                _draggingAttempt = false;

                // Always indicate the left mouse was pressed
                OnLeftMouseDown(EventArgs.Empty);

                // Remember point when mouse when pressed, in case we want to start a drag/drop operation
                _dragRect = new Rectangle(pt, Size.Empty);
                _dragRect.Inflate(SystemInformation.DragSize);
            }
            else if (button == MouseButtons.Right)
            {
                // Always indicate the right mouse was pressed
                OnRightMouseDown(EventArgs.Empty);
            }

			return _captured;
		}

10. Example

Project: Krypton
Source File: ContentTreeView.cs
protected override void OnMouseDown(MouseEventArgs e)
        {
            // Find the tree node under the mouse point
            Point pt = new Point(e.X, e.Y);
            TreeNode nodeDown = GetNodeAt(pt);

            // If there is a node under the mouse
            if (nodeDown != null)
            {
                // Ensure the node is selected
                if (SelectedNode != nodeDown)
                    SelectedNode = nodeDown;

                // Left mouse down means we might be starting a drag operation
                if (e.Button == MouseButtons.Left)
                {
                    _dragNode = nodeDown;
                    _dragRect = new Rectangle(pt, Size.Empty);
                    _dragRect.Inflate(SystemInformation.DragSize);
                }
            }

            base.OnMouseDown(e);
        }

11. Example

Project: Krypton
Source File: PageDragTreeView.cs
protected override void OnMouseDown(MouseEventArgs e)
        {
            // Grab the node under the mouse
            Point pt = new Point(e.X, e.Y);
            TreeNode nodeDown = GetNodeAt(pt);

            // Try and ensure the node is selected on the mouse down
            if ((nodeDown != null) && (SelectedNode != nodeDown))
                SelectedNode = nodeDown;

            // Mouse down could be a prelude to a drag operation
            if (e.Button == MouseButtons.Left)
            {
                // Remember the node as a potential drag node
                _dragNode = nodeDown;

                // Create the rectangle that moving outside causes a drag operation
                _dragRect = new Rectangle(pt, Size.Empty);
                _dragRect.Inflate(SystemInformation.DragSize);
            }

            base.OnMouseDown(e);
        }

12. Example

Project: IceChat
Source File: IceDockPanel.cs
private void OnMouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left) return;

            Rectangle r = new Rectangle(DragStartPosition, Size.Empty);
            r.Inflate(SystemInformation.DragSize);

            TabPage tp = HoverTab();

            if (tp != null)
            {
                if (!r.Contains(e.X, e.Y))
                    _tabControl.DoDragDrop(tp, DragDropEffects.All);
            }
            DragStartPosition = Point.Empty;
        }

13. Example

Project: DotSpatial
Source File: CharacterControl.cs
protected override void OnMouseUp(MouseEventArgs e)
        {
            if (_isPopup)
            {
                Rectangle pRect = GetPopupRectangle();
                Rectangle cRect = DocumentToClient(pRect);
                if (cRect.Contains(e.Location))
                {
                    _isPopup = false; // make the popup vanish, but don't change the selection.
                    cRect.Inflate(CellSize);
                    Invalidate(cRect);
                    OnPopupClicked();
                    return;
                }
            }

            if (e.X < 0) return;
            if (e.Y < 0) return;

            int col = (e.X + ControlRectangle.X) / _cellSize.Width;
            int row = (e.Y + ControlRectangle.Y) / _cellSize.Height;
            if (((_numColumns * row) + col) < 256)
            {
                IsSelected = true;
                SelectedChar = (byte)((_numColumns * row) + col);
                _isPopup = true;
            }

            Invalidate();
            base.OnMouseUp(e);
        }

14. Example

Project: tesvsnip
Source File: Decorations.cs
protected void DrawFilledBorder(Graphics g, Rectangle bounds)
        {
            bounds.Inflate(BoundsPadding);
            GraphicsPath path = GetRoundedRect(bounds, CornerRounding);
            if (FillGradientFrom != null && FillGradientTo != null)
            {
                if (FillBrush != null)
                    FillBrush.Dispose();
                FillBrush = new LinearGradientBrush(bounds, FillGradientFrom.Value, FillGradientTo.Value,
                                                    FillGradientMode);
            }
            if (FillBrush != null)
                g.FillPath(FillBrush, path);
            if (BorderPen != null)
                g.DrawPath(BorderPen, path);
        }

15. Example

Project: tesvsnip
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r)
        {
            if (!r.Contains(olv.PointToClient(Cursor.Position)))
                return;

            Rectangle bounds = RowBounds;
            if (bounds.IsEmpty)
            {
                if (olv.View == View.Tile)
                    g.FillRectangle(FillBrush, r);
                return;
            }

            using (var newClip = new Region(r))
            {
                bounds.Inflate(BoundsPadding);
                newClip.Exclude(GetRoundedRect(bounds, CornerRounding));
                Region originalClip = g.Clip;
                g.Clip = newClip;
                g.FillRectangle(FillBrush, r);
                g.Clip = originalClip;
            }
        }

16. Example

Project: falloutsnip
Source File: Decorations.cs
protected void DrawFilledBorder(Graphics g, Rectangle bounds)
        {
            bounds.Inflate(BoundsPadding);
            GraphicsPath path = GetRoundedRect(bounds, CornerRounding);
            if (FillGradientFrom != null && FillGradientTo != null)
            {
                if (FillBrush != null)
                    FillBrush.Dispose();
                FillBrush = new LinearGradientBrush(bounds, FillGradientFrom.Value, FillGradientTo.Value,
                                                    FillGradientMode);
            }
            if (FillBrush != null)
                g.FillPath(FillBrush, path);
            if (BorderPen != null)
                g.DrawPath(BorderPen, path);
        }

17. Example

Project: falloutsnip
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r)
        {
            if (!r.Contains(olv.PointToClient(Cursor.Position)))
                return;

            Rectangle bounds = RowBounds;
            if (bounds.IsEmpty)
            {
                if (olv.View == View.Tile)
                    g.FillRectangle(FillBrush, r);
                return;
            }

            using (var newClip = new Region(r))
            {
                bounds.Inflate(BoundsPadding);
                newClip.Exclude(GetRoundedRect(bounds, CornerRounding));
                Region originalClip = g.Clip;
                g.Clip = newClip;
                g.FillRectangle(FillBrush, r);
                g.Clip = originalClip;
            }
        }

18. Example

Project: MapViewer
Source File: Decorations.cs
protected void DrawFilledBorder(Graphics g, Rectangle bounds) {
            bounds.Inflate(this.BoundsPadding);
            GraphicsPath path = this.GetRoundedRect(bounds, this.CornerRounding);
            if (this.FillGradientFrom != null && this.FillGradientTo != null) {
                if (this.FillBrush != null)
                    this.FillBrush.Dispose();
                this.FillBrush = new LinearGradientBrush(bounds, this.FillGradientFrom.Value, this.FillGradientTo.Value, this.FillGradientMode);
            }
            if (this.FillBrush != null)
                g.FillPath(this.FillBrush, path);
            if (this.BorderPen != null)
                g.DrawPath(this.BorderPen, path);
        }

19. Example

Project: logwizard
Source File: Decorations.cs
protected void DrawFilledBorder(Graphics g, Rectangle bounds) {
            bounds.Inflate(this.BoundsPadding);
            GraphicsPath path = this.GetRoundedRect(bounds, this.CornerRounding);
            if (this.FillGradientFrom != null && this.FillGradientTo != null) {
                if (this.FillBrush != null)
                    this.FillBrush.Dispose();
                this.FillBrush = new LinearGradientBrush(bounds, this.FillGradientFrom.Value, this.FillGradientTo.Value, this.FillGradientMode);
            }
            if (this.FillBrush != null)
                g.FillPath(this.FillBrush, path);
            if (this.BorderPen != null)
                g.DrawPath(this.BorderPen, path);
        }

20. Example

Project: logwizard
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r) {
            if (!r.Contains(olv.PointToClient(Cursor.Position)))
                return;

            Rectangle bounds = this.RowBounds;
            if (bounds.IsEmpty) {
                if (olv.View == View.Tile)
                    g.FillRectangle(this.FillBrush, r);
                return;
            }

            using (Region newClip = new Region(r)) {
                bounds.Inflate(this.BoundsPadding);
                newClip.Exclude(this.GetRoundedRect(bounds, this.CornerRounding));
                Region originalClip = g.Clip;
                g.Clip = newClip;
                g.FillRectangle(this.FillBrush, r);
                g.Clip = originalClip;
            }
        }

21. Example

Project: SquareOne
Source File: Decorations.cs
protected void DrawFilledBorder(Graphics g, Rectangle bounds) {
            bounds.Inflate(this.BoundsPadding);
            GraphicsPath path = this.GetRoundedRect(bounds, this.CornerRounding);
            if (this.FillGradientFrom != null && this.FillGradientTo != null) {
                if (this.FillBrush != null)
                    this.FillBrush.Dispose();
                this.FillBrush = new LinearGradientBrush(bounds, this.FillGradientFrom.Value, this.FillGradientTo.Value, this.FillGradientMode);
            }
            if (this.FillBrush != null)
                g.FillPath(this.FillBrush, path);
            if (this.BorderPen != null)
                g.DrawPath(this.BorderPen, path);
        }

22. Example

Project: SquareOne
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r) {
            if (!r.Contains(olv.PointToClient(Cursor.Position)))
                return;

            Rectangle bounds = this.RowBounds;
            if (bounds.IsEmpty) {
                if (olv.View == View.Tile)
                    g.FillRectangle(this.FillBrush, r);
                return;
            }

            using (Region newClip = new Region(r)) {
                bounds.Inflate(this.BoundsPadding);
                newClip.Exclude(this.GetRoundedRect(bounds, this.CornerRounding));
                Region originalClip = g.Clip;
                g.Clip = newClip;
                g.FillRectangle(this.FillBrush, r);
                g.Clip = originalClip;
            }
        }

23. Example

Project: tesvsnip
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r)
        {
            if (!olv.IsCellEditing)
                return;

            Rectangle bounds = olv.CellEditor.Bounds;
            if (bounds.IsEmpty)
                return;

            bounds.Inflate(BoundsPadding);
            GraphicsPath path = GetRoundedRect(bounds, CornerRounding);
            if (FillBrush != null)
            {
                if (UseLightbox)
                {
                    using (var newClip = new Region(r))
                    {
                        newClip.Exclude(path);
                        Region originalClip = g.Clip;
                        g.Clip = newClip;
                        g.FillRectangle(FillBrush, r);
                        g.Clip = originalClip;
                    }
                }
                else
                {
                    g.FillPath(FillBrush, path);
                }
            }
            if (BorderPen != null)
                g.DrawPath(BorderPen, path);
        }

24. Example

Project: falloutsnip
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r)
        {
            if (!olv.IsCellEditing)
                return;

            Rectangle bounds = olv.CellEditor.Bounds;
            if (bounds.IsEmpty)
                return;

            bounds.Inflate(BoundsPadding);
            GraphicsPath path = GetRoundedRect(bounds, CornerRounding);
            if (FillBrush != null)
            {
                if (UseLightbox)
                {
                    using (var newClip = new Region(r))
                    {
                        newClip.Exclude(path);
                        Region originalClip = g.Clip;
                        g.Clip = newClip;
                        g.FillRectangle(FillBrush, r);
                        g.Clip = originalClip;
                    }
                }
                else
                {
                    g.FillPath(FillBrush, path);
                }
            }
            if (BorderPen != null)
                g.DrawPath(BorderPen, path);
        }

25. Example

Project: MapViewer
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r) {
            if (!olv.IsCellEditing) 
                return;

            Rectangle bounds = olv.CellEditor.Bounds;
            if (bounds.IsEmpty)
                return;

            bounds.Inflate(this.BoundsPadding);
            GraphicsPath path = this.GetRoundedRect(bounds, this.CornerRounding);
            if (this.FillBrush != null) {
                if (this.UseLightbox) {
                    using (Region newClip = new Region(r)) {
                        newClip.Exclude(path);
                        Region originalClip = g.Clip;
                        g.Clip = newClip;
                        g.FillRectangle(this.FillBrush, r);
                        g.Clip = originalClip;
                    }
                } else {
                    g.FillPath(this.FillBrush, path);
                }
            }
            if (this.BorderPen != null)
                g.DrawPath(this.BorderPen, path);
        }

26. Example

Project: MapViewer
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r) {
            if (!r.Contains(olv.PointToClient(Cursor.Position)))
                return;

            Rectangle bounds = this.RowBounds;
            if (bounds.IsEmpty) {
                if (olv.View == View.Tile)
                    g.FillRectangle(this.FillBrush, r);
                return;
            }

            using (Region newClip = new Region(r)) {
                bounds.Inflate(this.BoundsPadding);
                newClip.Exclude(this.GetRoundedRect(bounds, this.CornerRounding));
                Region originalClip = g.Clip;
                g.Clip = newClip;
                g.FillRectangle(this.FillBrush, r);
                g.Clip = originalClip;
            }
        }

27. Example

Project: logwizard
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r) {
            if (!olv.IsCellEditing) 
                return;

            Rectangle bounds = olv.CellEditor.Bounds;
            if (bounds.IsEmpty)
                return;

            bounds.Inflate(this.BoundsPadding);
            GraphicsPath path = this.GetRoundedRect(bounds, this.CornerRounding);
            if (this.FillBrush != null) {
                if (this.UseLightbox) {
                    using (Region newClip = new Region(r)) {
                        newClip.Exclude(path);
                        Region originalClip = g.Clip;
                        g.Clip = newClip;
                        g.FillRectangle(this.FillBrush, r);
                        g.Clip = originalClip;
                    }
                } else {
                    g.FillPath(this.FillBrush, path);
                }
            }
            if (this.BorderPen != null)
                g.DrawPath(this.BorderPen, path);
        }

28. Example

Project: Legends-Viewer
Source File: DwarfTabControl.cs
protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            TCHITTESTINFO HTI = new TCHITTESTINFO(e.X, e.Y);
            HotTabIndex = SendMessage(this.Handle, TCM_HITTEST, IntPtr.Zero, ref HTI);

            if (e.Button != MouseButtons.Left) return;

            Rectangle r = new Rectangle(DragStartPosition, Size.Empty);
            r.Inflate(SystemInformation.DragSize);

            TabPage tp = HoverTab();

            if (tp != null)
            {
                if (!r.Contains(e.X, e.Y))
                    this.DoDragDrop(tp, DragDropEffects.All);
            }
            DragStartPosition = Point.Empty;
        }

29. Example

Project: StackBuilder
Source File: ListBoxImages.cs
public void drawItem(DrawItemEventArgs e, Padding margin, Size imageSize, bool selected)
        {
            // draw background
            e.Graphics.FillRectangle(Brushes.White, e.Bounds);
            // draw some item separator
            e.Graphics.DrawLine(Pens.DarkGray, e.Bounds.X, e.Bounds.Y, e.Bounds.X + e.Bounds.Width, e.Bounds.Y);
            // draw item image
            e.Graphics.DrawImage(this._texture.Bitmap, e.Bounds.X + margin.Left, e.Bounds.Y + margin.Top, imageSize.Width, imageSize.Height);
            // if selected draw blue rectangle
            if (selected)
            {
                Rectangle rect = e.Bounds;
                rect.Inflate(new Size(-2, -2));
                e.Graphics.DrawRectangle(new Pen(Color.Blue, 2.0f), e.Bounds);
            }
            // put some focus rectangle
            e.DrawFocusRectangle();
        }

30. Example

Project: SquareOne
Source File: Decorations.cs
public override void Draw(ObjectListView olv, Graphics g, Rectangle r) {
            if (!olv.IsCellEditing) 
                return;

            Rectangle bounds = olv.CellEditor.Bounds;
            if (bounds.IsEmpty)
                return;

            bounds.Inflate(this.BoundsPadding);
            GraphicsPath path = this.GetRoundedRect(bounds, this.CornerRounding);
            if (this.FillBrush != null) {
                if (this.UseLightbox) {
                    using (Region newClip = new Region(r)) {
                        newClip.Exclude(path);
                        Region originalClip = g.Clip;
                        g.Clip = newClip;
                        g.FillRectangle(this.FillBrush, r);
                        g.Clip = originalClip;
                    }
                } else {
                    g.FillPath(this.FillBrush, path);
                }
            }
            if (this.BorderPen != null)
                g.DrawPath(this.BorderPen, path);
        }

31. Example

Project: tinvedit
Source File: ColoredProgressBar.cs
protected override void OnPaint(PaintEventArgs e)
        {
            var Base = new Rectangle(0, 0, Width, Height);
            var ProgressRect = GetProgressRect();
            var HighBar = new Rectangle(1, 1, ProgressRect.Width,
                (int) Math.Round(Math.Truncate(ProgressRect.Height * 0.45)));

            if (ProgressBarRenderer.IsSupported)
                ProgressBarRenderer.DrawHorizontalBar(e.Graphics, Base);
            var size = new Size(-2, -2);
            Base.Inflate(size);
            e.Graphics.FillRectangle(BaseBrush, Base);

            e.Graphics.FillRectangle(BackgroudBrush, ProgressRect);
            e.Graphics.FillRectangle(ForegroudBrush, ProgressRect);

            e.Graphics.DrawLine(Line, 1, 1, 1, ProgressRect.Height);
            e.Graphics.DrawLine(Line, ProgressRect.Width, 1, ProgressRect.Width, ProgressRect.Height);

            e.Graphics.FillRectangle(HueBrush, HighBar);
        }

32. Example

Project: IceChat
Source File: ChannelBar.cs
private void OnMouseMove(object sender, MouseEventArgs e)
        {
            if (_tabSizeRects.Co/n ..... /n //View Source file for more details /n }

33. Example

Project: OpenUO
Source File: ArtworkControlOld.cs
protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

          /n ..... /n //View Source file for more details /n }

34. Example

Project: bdhero
Source File: ProgressBar2.cs
protected override void OnPaint(PaintEventArgs e)
        {
            if (!UseCustomColors)
      /n ..... /n //View Source file for more details /n }