System.Windows.Rect.Inflate C# (CSharp) Method

Inflate() public static method

public static Inflate ( Rect rect, Size size ) : Rect
rect Rect
size Size
return Rect
        public static Rect Inflate(Rect rect, Size size)
        {
            rect.Inflate(size._width, size._height);
            return rect;
        }

Same methods

Rect::Inflate ( Rect rect, double width, double height ) : Rect
Rect::Inflate ( Size size ) : void
Rect::Inflate ( double width, double height ) : void

Usage Example

Example #1
0
        public void Update()
        {
            Drawing.Width  = width * Scale;
            Drawing.Height = height * Scale;
            Drawing.OpenLayers();

            var nodes    = Nodes.Where(n => n != null).ToArray();
            var segments = Segments.Where(n => n != null).ToArray();

            foreach (TrafficNode node in nodes)
            {
                node.Update();
            }
            foreach (TrafficSegment segment in segments.OrderBy(m => (m?.Description as TrafficSegmentDescription)?.Type))
            {
                segment.Update();
            }

            var layer = Drawing.GetLayer(DrawingLayer.Outlines);

            var rect = new System.Windows.Rect(0, 0, Drawing.Width, Drawing.Height);

            rect.Inflate(-10.0, -10.0);
            layer.DrawRectangle(null, new Pen(Brushes.HotPink, 1), rect);

            Drawing.CloseLayers();
            //Drawing.InvalidateVisual();
        }
All Usage Examples Of System.Windows.Rect::Inflate