예제 #1
0
        private static Pen GetStroke(
            ContentScanner.GraphicsState state
            )
        {
            Pen stroke = new Pen(
                state.StrokeColorSpace.GetPaint(state.StrokeColor),
                (float)state.LineWidth
                );

            {
                LineCap lineCap = state.LineCap.ToGdi();
                stroke.SetLineCap(lineCap, lineCap, lineCap.ToDashCap());
                stroke.LineJoin   = state.LineJoin.ToGdi();
                stroke.MiterLimit = (float)state.MiterLimit;

                LineDash lineDash  = state.LineDash;
                double[] dashArray = lineDash.DashArray;
                if (dashArray.Length > 0)
                {
                    stroke.DashPattern = ConvertUtils.ToFloatArray(dashArray);
                    stroke.DashOffset  = (float)lineDash.DashPhase;
                }
            }
            return(stroke);
        }
예제 #2
0
        private static Pen GetStroke(
            ContentScanner.GraphicsState state
            )
        {
            Pen stroke = new Pen(
                state.StrokeColorSpace.GetPaint(state.StrokeColor),
                state.LineWidth
                );

            {
                LineCap lineCap = state.LineCap.ToGdi();
                stroke.SetLineCap(lineCap, lineCap, lineCap.ToDashCap());
                stroke.LineJoin    = state.LineJoin.ToGdi();
                stroke.MiterLimit  = state.MiterLimit;
                stroke.DashPattern = state.LineDash.DashArray;
                stroke.DashOffset  = state.LineDash.DashPhase;
            }
            return(stroke);
        }