internal static void SetFill(PdfRenderContext context, Brush brush, double width, double height)
        {
            var fill = PdfColorHelper.ConvertBrush(brush, context.opacity, context.drawingSurface.Position, width, height);

            context.drawingSurface.GraphicProperties.IsFilled  = fill != null;
            context.drawingSurface.GraphicProperties.FillColor = fill;
        }
        internal static void SetStroke(PdfRenderContext context, double thickness, Brush brush, double width, double height, DoubleCollection dashArray)
        {
            var stroke = PdfColorHelper.ConvertBrush(brush, context.opacity, context.drawingSurface.Position, width, height);

            context.drawingSurface.GraphicProperties.IsStroked = thickness != 0 && stroke != null;

            if (context.drawingSurface.GraphicProperties.IsStroked)
            {
                context.drawingSurface.GraphicProperties.StrokeThickness = thickness;
                context.drawingSurface.GraphicProperties.StrokeColor     = stroke;

                if (dashArray != null)
                {
                    context.drawingSurface.GraphicProperties.StrokeDashArray = dashArray;
                }
            }
        }
示例#3
0
        internal static void SetStroke(PdfRenderContext context, double thickness, Brush brush, double width, double height)
        {
            context.drawingSurface.GraphicProperties.IsStroked = thickness != 0;
            if (!context.drawingSurface.GraphicProperties.IsStroked)
            {
                return;
            }

            context.drawingSurface.GraphicProperties.StrokeThickness = thickness;

            var stroke = PdfColorHelper.ConvertBrush(brush, context.opacity, context.drawingSurface.Position, width, height);

            if (stroke != null)
            {
                context.drawingSurface.GraphicProperties.StrokeColor = stroke;
            }
            else
            {
                context.drawingSurface.GraphicProperties.IsStroked = false;
            }
        }