Svg.SvgRenderer.DrawPath C# (CSharp) Method

DrawPath() public method

public DrawPath ( Pen pen, GraphicsPath path ) : void
pen System.Drawing.Pen
path System.Drawing.Drawing2D.GraphicsPath
return void
        public void DrawPath(Pen pen, GraphicsPath path)
        {
            this._innerGraphics.DrawPath(pen, path);
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Common code for rendering a marker once the orientation angle has been calculated
        /// </summary>
        /// <param name="fAngle"></param>
        /// <param name="pRenderer"></param>
        /// <param name="pOwner"></param>
        /// <param name="pMarkerPoint"></param>
        private void RenderPart2(float fAngle, SvgRenderer pRenderer, SvgPath pOwner, PointF pMarkerPoint)
        {
            Pen pRenderPen = CreatePen(pOwner, pRenderer);

            GraphicsPath markerPath = GetClone(pOwner);

            Matrix transMatrix = new Matrix();

            transMatrix.Translate(pMarkerPoint.X, pMarkerPoint.Y);
            if (Orient.IsAuto)
            {
                transMatrix.Rotate(fAngle);
            }
            else
            {
                transMatrix.Rotate(Orient.Angle);
            }
            switch (MarkerUnits)
            {
            case SvgMarkerUnits.strokeWidth:
                transMatrix.Translate(AdjustForViewBoxWidth(-RefX.ToDeviceValue(pRenderer, UnitRenderingType.Horizontal, this) *
                                                            pOwner.StrokeWidth.ToDeviceValue(pRenderer, UnitRenderingType.Other, this)),
                                      AdjustForViewBoxHeight(-RefY.ToDeviceValue(pRenderer, UnitRenderingType.Vertical, this) *
                                                             pOwner.StrokeWidth.ToDeviceValue(pRenderer, UnitRenderingType.Other, this)));
                break;

            case SvgMarkerUnits.userSpaceOnUse:
                transMatrix.Translate(-RefX.ToDeviceValue(pRenderer, UnitRenderingType.Horizontal, this),
                                      -RefY.ToDeviceValue(pRenderer, UnitRenderingType.Vertical, this));
                break;
            }
            markerPath.Transform(transMatrix);
            pRenderer.DrawPath(pRenderPen, markerPath);

            SvgPaintServer pFill     = Fill;
            SvgFillRule    pFillRule = FillRule;                                                        // TODO: What do we use the fill rule for?
            float          fOpacity  = FillOpacity;

            if (pFill != null)
            {
                Brush pBrush = pFill.GetBrush(this, pRenderer, fOpacity);
                pRenderer.FillPath(pBrush, markerPath);
                pBrush.Dispose();
            }
            pRenderPen.Dispose();
            markerPath.Dispose();
            transMatrix.Dispose();
        }
All Usage Examples Of Svg.SvgRenderer::DrawPath