System.Drawing.Drawing2D.GraphicsPath.GetBounds()

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

89 Examples 7

1. Example

Project: VisualPlus
Source File: GraphicsPathExtension.cs
public static GraphicsPath ToBorderPath(this GraphicsPath borderPath, Border border)
        {
            return VisualBorderRenderer.CreateBorderTypePath(borderPath.GetBounds().ToRectangle(), border);
        }

2. Example

Project: NHibernate.Spatial
Source File: PolygonGraphicsPath.cs
public RectangleF GetBoundsF()
        {
            return Path.GetBounds();
        }

3. Example

Project: dockpanelsuite
Source File: VS2005AutoHideStrip.cs
protected override Rectangle GetTabBounds(Tab tab)
        {
            GraphicsPath path = GetTabOutline((TabVS2005)tab, true, true);
            RectangleF bounds = path.GetBounds();
            return new Rectangle((int)bounds.Left, (int)bounds.Top, (int)bounds.Width, (int)bounds.Height);
        }

4. Example

Project: dockpanelsuite
Source File: VS2005DockPaneStrip.cs
protected override Rectangle GetTabBounds(Tab tab)
        {
            GraphicsPath path = GetTabOutline(tab, true, false);
            RectangleF rectangle = path.GetBounds();
            return new Rectangle((int)rectangle.Left, (int)rectangle.Top, (int)rectangle.Width, (int)rectangle.Height);
        }

5. Example

Project: dockpanelsuite
Source File: VS2005MultithreadingAutoHideStrip.cs
protected override Rectangle GetTabBounds(Tab tab)
        {
            GraphicsPath path = GetTabOutline((TabVS2005)tab, true, true);
            RectangleF bounds = path.GetBounds();
            return new Rectangle((int)bounds.Left, (int)bounds.Top, (int)bounds.Width, (int)bounds.Height);
        }

6. Example

Project: dockpanelsuite
Source File: VS2005MultithreadingDockPaneStrip.cs
protected override Rectangle GetTabBounds(Tab tab)
        {
            GraphicsPath path = GetTabOutline(tab, true, false);
            RectangleF rectangle = path.GetBounds();
            return new Rectangle((int)rectangle.Left, (int)rectangle.Top, (int)rectangle.Width, (int)rectangle.Height);
        }

7. Example

Project: dockpanelsuite
Source File: VS2012AutoHideStrip.cs
protected override Rectangle GetTabBounds(Tab tab)
        {
            GraphicsPath path = GetTabOutline((TabVS2012)tab, true);
            RectangleF bounds = path.GetBounds();
            return new Rectangle((int)bounds.Left, (int)bounds.Top, (int)bounds.Width, (int)bounds.Height);
        }

8. Example

Project: dockpanelsuite
Source File: VS2012DockPaneStrip.cs
protected override Rectangle GetTabBounds(Tab tab)
        {
            GraphicsPath path = GetTabOutline(tab, true, false);
            RectangleF rectangle = path.GetBounds();
            return new Rectangle((int)rectangle.Left, (int)rectangle.Top, (int)rectangle.Width, (int)rectangle.Height);
        }

9. Example

Project: dockpanelsuite
Source File: VS2013DockPaneStrip.cs
protected override Rectangle GetTabBounds(Tab tab)
        {
            GraphicsPath path = GetTabOutline(tab, true, false);
            RectangleF rectangle = path.GetBounds();
            return new Rectangle((int)rectangle.Left, (int)rectangle.Top, (int)rectangle.Width, (int)rectangle.Height);
        }

10. Example

Project: referencesource
Source File: Selection.cs
[
        System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedPar/n ..... /n //View Source file for more details /n }

11. Example

Project: referencesource
Source File: Selection.cs
internal void AddHotRegion(
			GraphicsPath path, 
			bool relativePath,
			ChartElementType type,
			object selectedObject
			) 
		{
			if( ( ProcessChartMode & ProcessMode.HotRegions ) == ProcessMode.HotRegions )
			{
						
				HotRegion region = new HotRegion();
						
				region.SelectedObject = selectedObject;
				region.Type = type;
                region.Path = (GraphicsPath)path.Clone();
				region.BoundingRectangle = path.GetBounds();
				region.RelativeCoordinates = relativePath;

				_regionList.Add( region );

			}
		}

12. Example

Project: NHibernate.Spatial
Source File: GeometryCollectionGraphicsPath.cs
public RectangleF GetBoundsF()
        {
            var rectangle = new RectangleF();

            foreach (var shape in _shapes)
            {
                rectangle = rectangle.IsEmpty
                    ? shape.GetBounds()
                    : RectangleF.Union(rectangle, shape.GetBounds());
            }

            return rectangle;
        }

13. Example

Project: SharpMap
Source File: WarpPathToPath.cs
internal static GraphicsPath PrepareTextPathToWarp(GraphicsPath path, Double totalPathLength, bool ignoreLength, StringFormat format)
        {
            var rect = path.GetBounds();

            double maxX = rect.Right;
            double minX = rect.Left;

            //Check if text path fits or is really wanted
            double len = maxX - minX;
            if (len > totalPathLength && !ignoreLength)
                return null;

            //Offset for center
            double xStart;
            switch (format.Alignment)
            {
                default:
                    xStart = (totalPathLength) * 0.5d;
                    break;
                case StringAlignment.Near:
                    xStart = 0;
                    break;
                case StringAlignment.Far:
                    xStart = totalPathLength;
                    break;
            }
            path.Transform(new Matrix(1f, 0f, 0f, 1f, (float)xStart, 0f));

            return path;
        }

14. Example

Project: TDMaker
Source File: Symbol.cs
public void DrawSymbol( Graphics g, GraphPane pane, int x, int y,
							float scaleFactor, bool isSelected, PointPair dataValue )
		{
			Symbol source = this;
			if ( isSelected )
				source = Selection.Symbol;

			// Only draw if the symbol is visible
			if (	_isVisible &&
					this.Type != SymbolType.None &&
					x < 100000 && x > -100000 &&
					y < 100000 && y > -100000 )
			{
				SmoothingMode sModeSave = g.SmoothingMode;
				if ( _isAntiAlias )
					g.SmoothingMode = SmoothingMode.HighQuality;

				using ( Pen pen = _border.GetPen( pane, scaleFactor, dataValue ) )
				using ( GraphicsPath path = this.MakePath( g, scaleFactor ) )
				using ( Brush brush = this.Fill.MakeBrush( path.GetBounds(), dataValue ) )
				{
					DrawSymbol( g, x, y, path, pen, brush );
				}

				g.SmoothingMode = sModeSave;
			}
		}

15. Example

Project: referencesource
Source File: Selection.cs
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters",/n ..... /n //View Source file for more details /n }

16. Example

Project: referencesource
Source File: Selection.cs
private RectangleF GetHotRegionRectangle(HotRegion rgn, RectangleF unionWith, ChartElementType elementType)
        {
            RectangleF rect;
            if (rgn.Path != null)
            {
                rect = rgn.Path.GetBounds();
            }
            else
            {
                rect = rgn.BoundingRectangle;
            }
            if (rgn.RelativeCoordinates)
            {
                rect = this.Graph.GetAbsoluteRectangle(rect);
            }
            if (elementType == ChartElementType.AxisLabels)
            {
                if (rect.Width > rect.Height)
                {
                    rect.Inflate(-5, -2);
                }
                else if (rect.Width < rect.Height)
                {
                    rect.Inflate(-2, -5);
                }
            }
            if (!unionWith.IsEmpty)
            {
                return RectangleF.Union(unionWith, rect);
            }
            return rect;
        }

17. Example

Project: ZedGraph
Source File: Symbol.cs
public void DrawSymbol( Graphics g, GraphPane pane, int x, int y,
							float scaleFactor, bool isSelected, PointPair dataValue )
		{
			Symbol source = this;
			if ( isSelected )
				source = Selection.Symbol;

			// Only draw if the symbol is visible
			if (	_isVisible &&
					this.Type != SymbolType.None &&
					x < 100000 && x > -100000 &&
					y < 100000 && y > -100000 )
			{
				SmoothingMode sModeSave = g.SmoothingMode;
				if ( _isAntiAlias )
					g.SmoothingMode = SmoothingMode.HighQuality;

				using ( Pen pen = _border.GetPen( pane, scaleFactor, dataValue ) )
				using ( GraphicsPath path = this.MakePath( g, scaleFactor ) )
				using ( Brush brush = this.Fill.MakeBrush( path.GetBounds(), dataValue ) )
				{
					DrawSymbol( g, x, y, path, pen, brush );
				}

				g.SmoothingMode = sModeSave;
			}
		}

18. Example

Project: Krypton
Source File: KryptonOffice2007Renderer.cs
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
        {
            // Cann/n ..... /n //View Source file for more details /n }

19. Example

Project: Krypton
Source File: KryptonOffice2010Renderer.cs
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
        {
            // Cann/n ..... /n //View Source file for more details /n }

20. Example

Project: Krypton
Source File: KryptonSparkleRenderer.cs
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
        {
            // Cann/n ..... /n //View Source file for more details /n }

21. Example

Project: Krypton
Source File: RenderStandard.cs
private void DrawBackSolidInside(RenderContext context,
                                         Rec/n ..... /n //View Source file for more details /n }

22. Example

Project: MapleShark
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

23. Example

Project: dockpanelsuite
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
            {
             /n ..... /n //View Source file for more details /n }

24. Example

Project: dockpanelsuite
Source File: VS2012DockOutlineFactory.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
            {
             /n ..... /n //View Source file for more details /n }

25. Example

Project: ArnoldSimulator
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
            {
             /n ..... /n //View Source file for more details /n }

26. Example

Project: ArnoldSimulator
Source File: VS2012LightTheme.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

27. Example

Project: lua-tilde
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

28. Example

Project: TDMaker
Source File: PolyObj.cs
override public void Draw( Graphics g, PaneBase pane, float scaleFactor )
		{
			if ( _points != null && _points.Length > 1 )
			{
				using ( GraphicsPath path = MakePath( pane ) )
				{
					// Fill or draw the symbol as required
					if ( _fill.IsVisible )
					{
						using ( Brush brush = this.Fill.MakeBrush( path.GetBounds() ) )
							g.FillPath( brush, path );
					}

					if ( _border.IsVisible )
					{
						using ( Pen pen = _border.GetPen( pane, scaleFactor ) )
							g.DrawPath( pen, path );
					}
				}
			}
		}

29. Example

Project: referencesource
Source File: AreaChart.cs
private void FillLastSeriesGradient(ChartGraphics graph)
		{
			// Add last line in the path
			if(areaPath != null)
			{
				areaPath.AddLine(areaPath.GetLastPoint().X, areaPath.GetLastPoint().Y, areaPath.GetLastPoint().X, axisPos.Y);
			}
			
			// Fill whole area with gradient
			if(gradientFill && areaPath != null)
			{
				// Set clip region
				graph.SetClip( Area.PlotAreaPosition.ToRectangleF() );

				// Create brush
                using (Brush areaGradientBrush = graph.GetGradientBrush(areaPath.GetBounds(), this.Series.Color, this.Series.BackSecondaryColor, this.Series.BackGradientStyle))
                {
                    // Fill area with gradient
                    graph.FillPath(areaGradientBrush, areaPath);
                    gradientFill = false;
                }

				// Reset clip region
				graph.ResetClip();
			}
			if(areaPath != null)
			{
				areaPath.Dispose();
				areaPath = null;
			}
		}

30. Example

Project: referencesource
Source File: FastLineChart.cs
public virtual void DrawLine(
			Series series,
			DataPoint point,
			DataPoint pointMin,
			DataPo/n ..... /n //View Source file for more details /n }

31. Example

Project: Nexus-Mod-Manager
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

32. Example

Project: ShareX
Source File: FreehandContainer.cs
public override bool HandleMouseMove(int mouseX, int mouseY)
        {
            Point previousPoint = capturePoints[capturePoints.Count - 1];

            if (GeometryHelper.Distance2D(previousPoint.X, previousPoint.Y, mouseX, mouseY) >= 2 * EditorConfig.FreehandSensitivity)
            {
                capturePoints.Add(new Point(mouseX, mouseY));
            }
            if (GeometryHelper.Distance2D(lastMouse.X, lastMouse.Y, mouseX, mouseY) >= EditorConfig.FreehandSensitivity)
            {
                //path.AddCurve(new Point[]{lastMouse, new Point(mouseX, mouseY)});
                freehandPath.AddLine(lastMouse, new Point(mouseX, mouseY));
                lastMouse = new Point(mouseX, mouseY);
                // Only re-calculate the bounds & redraw when we added something to the path
                myBounds = Rectangle.Round(freehandPath.GetBounds());
                Invalidate();
            }
            return true;
        }

33. Example

Project: ynoteclassic
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
            {
             /n ..... /n //View Source file for more details /n }

34. Example

Project: ynoteclassic
Source File: VS2012LightTheme.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

35. Example

Project: ShareX
Source File: FreehandContainer.cs
public override bool HandleMouseMove(int mouseX, int mouseY)
        {
            Point previousPoint = capturePoints[capturePoints.Count - 1];

            if (GeometryHelper.Distance2D(previousPoint.X, previousPoint.Y, mouseX, mouseY) >= (2 * EditorConfig.FreehandSensitivity))
            {
                capturePoints.Add(new Point(mouseX, mouseY));
            }
            if (GeometryHelper.Distance2D(lastMouse.X, lastMouse.Y, mouseX, mouseY) >= EditorConfig.FreehandSensitivity)
            {
                //path.AddCurve(new Point[]{lastMouse, new Point(mouseX, mouseY)});
                freehandPath.AddLine(lastMouse, new Point(mouseX, mouseY));
                lastMouse = new Point(mouseX, mouseY);
                // Only re-calculate the bounds & redraw when we added something to the path
                myBounds = Rectangle.Round(freehandPath.GetBounds());
                Invalidate();
            }
            return true;
        }

36. Example

Project: SquareOne
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

37. Example

Project: WGestures
Source File: CanvasWindowGestureView.cs
private void OnFadeOutTimerElapsed(object o, ElapsedEventArgs e)
        {
            lock (_fadeOuTimer)
            {
                if (!_fadeOuTimer.Enabled) return;

                Debug.Write("*");

                //???????????_fadeOutTo?
                var before = _canvasOpacity;
                _canvasOpacity -= FadeOutDelta;

                if (before < _canvasOpacity)
                {                    
                    EndView();
                    _fadeOuTimer.Enabled = false;
                }
                else
                {
                    _canvasWindow.SetDiBitmap(_canvasBuf, Rectangle.Ceiling(_labelRect), _canvasOpacity);
                    _canvasWindow.SetDiBitmap(_canvasBuf, Rectangle.Ceiling(_gPathDirty.GetBounds()), _canvasOpacity);
                }
            }
        }

38. Example

Project: WGestures
Source File: CanvasWindowGestureView.cs
private void ShowLabel(Color color, string text, Color bgColor)
        {
            _labelVisible = true;
            _labelColor = color;
            _labelText = text;
            _labelBgColor = bgColor;
            _labelChanged = true;

            _lastLabelRect = _labelRect;

            _labelPath.Reset();
            var msgPos = new PointF(_screenBounds.Width / 2, (_screenBounds.Height / 2) + _screenBounds.Width / 8);
            
            _labelPath.AddString(_labelText, _labelFont.FontFamily, 0, _labelFont.Size * _dpiFactor, msgPos, StringFormat.GenericDefault);
            _labelRect = _labelPath.GetBounds();
            msgPos.X -= _labelRect.Width / 2;

            _labelPath.Reset();
            _labelPath.AddString(_labelText, _labelFont.FontFamily, 0, _labelFont.Size * _dpiFactor, msgPos, StringFormat.GenericDefault);

            _labelRect = RectangleF.Inflate(_labelPath.GetBounds(), 25 * _dpiFactor, 15 * _dpiFactor);
        }

39. Example

Project: ZedGraph
Source File: PolyObj.cs
override public void Draw( Graphics g, PaneBase pane, float scaleFactor )
		{
			if ( _points != null && _points.Length > 1 )
			{
				using ( GraphicsPath path = MakePath( pane ) )
				{
					// Fill or draw the symbol as required
					if ( _fill.IsVisible )
					{
						using ( Brush brush = this.Fill.MakeBrush( path.GetBounds() ) )
							g.FillPath( brush, path );
					}

					if ( _border.IsVisible )
					{
						using ( Pen pen = _border.GetPen( pane, scaleFactor ) )
							g.DrawPath( pen, path );
					}
				}
			}
		}

40. Example

Project: ceptr
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

41. Example

Project: HOPE
Source File: DockPanel.DockDragHandler.cs
private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
                {
         /n ..... /n //View Source file for more details /n }

42. Example

Project: diagramnet
Source File: LineController.cs
public bool HitTest(Rectangle r)
		{
			GraphicsPath gp = new GraphicsPath();
			Matrix mtx = new Matrix();

			gp.AddRectangle(new Rectangle(el.Location.X,
				el.Location.Y,
				el.Size.Width,
				el.Size.Height));
			gp.Transform(mtx);
			Rectangle retGp = Rectangle.Round(gp.GetBounds());
			return r.Contains (retGp);
		}

43. Example

Project: diagramnet
Source File: RectangleController.cs
public virtual bool HitTest(Rectangle r)
		{
			GraphicsPath gp = new GraphicsPath();
			Matrix mtx = new Matrix();

			Point elLocation = el.Location;
			Size elSize = el.Size;
			gp.AddRectangle(new Rectangle(elLocation.X,
				elLocation.Y,
				elSize.Width,
				elSize.Height));
			gp.Transform(mtx);
			Rectangle retGp = Rectangle.Round(gp.GetBounds());
			return r.Contains (retGp);
		}

44. Example

Project: diagramnet
Source File: RightAngleLinkController.cs
bool Dalssoft.DiagramNet.IController.HitTest(Rectangle r)
		{
			GraphicsPath gp = new GraphicsPath();
			Matrix mtx = new Matrix();

			Point elLocation = el.Location;
			Size elSize = el.Size;
			gp.AddRectangle(new Rectangle(elLocation.X,
				elLocation.Y,
				elSize.Width,
				elSize.Height));
			gp.Transform(mtx);
			Rectangle retGp = Rectangle.Round(gp.GetBounds());
			return r.Contains (retGp);
		}

45. Example

Project: TDMaker
Source File: Symbol.cs
public void Draw( Graphics g, GraphPane pane, LineItem curve, float scaleFactor,
			bool isSelected /n ..... /n //View Source file for more details /n }

46. Example

Project: referencesource
Source File: ChartGraphics3D.cs
private void DrawBarStyleGradients(
			Matrix3D matrix, 
			BarDrawingStyle barDrawingStyle, 
			Rec/n ..... /n //View Source file for more details /n }

47. Example

Project: ShareX
Source File: RegionCaptureTasks.cs
public static Image ApplyRegionPathToImage(Image img, GraphicsPath gp)
        {
            if (img != null && gp != null)
            {
                Rectangle regionArea = Rectangle.Round(gp.GetBounds());
                Rectangle screenRectangle = CaptureHelpers.GetScreenBounds0Based();
                regionArea = Rectangle.Intersect(regionArea, screenRectangle);

                if (regionArea.IsValid())
                {
                    using (Bitmap bmp = img.CreateEmptyBitmap())
                    using (Graphics g = Graphics.FromImage(bmp))
                    using (TextureBrush brush = new TextureBrush(img))
                    {
                        g.PixelOffsetMode = PixelOffsetMode.Half;
                        g.SmoothingMode = SmoothingMode.HighQuality;

                        g.FillPath(brush, gp);

                        return ImageHelpers.CropBitmap(bmp, regionArea);
                    }
                }
            }

            return null;
        }

48. Example

Project: SharpMap
Source File: LabelLayer.cs
private static void CalculateLabelAroundOnLineString(ILineString line, ref BaseLabel label, MapViewp/n ..... /n //View Source file for more details /n }

49. Example

Project: ZedGraph
Source File: Symbol.cs
public void Draw( Graphics g, GraphPane pane, LineItem curve, float scaleFactor,
			bool isSelected /n ..... /n //View Source file for more details /n }

50. Example

Project: Toxy
Source File: ShapeCaptureHelpers.cs
public static Image GetRegionImage(Image surfaceImage, GraphicsPath regionFillPath, GraphicsPath regionDrawPath, SurfaceOptions options)
        {
            if (regionFillPath != null)
            {
                Image img;

                Rectangle regionArea = Rectangle.Round(regionFillPath.GetBounds());
                Rectangle screenRectangle = CaptureHelpers.GetScreenBounds0Based();
                Rectangle newRegionArea = Rectangle.Intersect(regionArea, screenRectangle);

                using (GraphicsPath gp = (GraphicsPath)regionFillPath.Clone())
                {
                    MoveGraphicsPath(gp, -Math.Max(0, regionArea.X), -Math.Max(0, regionArea.Y));
                    img = ImageHelpers.CropImage(surfaceImage, newRegionArea, gp);

                    if (options.DrawBorder)
                    {
                        GraphicsPath gpOutline = regionDrawPath ?? regionFillPath;

                        using (GraphicsPath gp2 = (GraphicsPath)gpOutline.Clone())
                        {
                            MoveGraphicsPath(gp2, -Math.Max(0, regionArea.X), -Math.Max(0, regionArea.Y));
                            img = ImageHelpers.DrawOutline(img, gp2);
                        }
                    }
                }

                return img;
            }

            return null;
        }