Example #1
0
        /// <summary>
        /// Create a new <see cref="SetLineJoin"/>.
        /// </summary>
        public SetLineJoin(LineJoinStyle join)
        {
            if (join < 0 || (int)join > 2)
            {
                throw new ArgumentException("Invalid argument passed for line join style. Should be 0, 1 or 2; instead got: " + join);
            }

            Join = join;
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the Bytescout.PDF.SolidPen class.
 /// </summary>
 public SolidPen()
 {
     _width       = 1;
     _color       = new ColorRGB(0, 0, 0);
     _lineCap     = LineCapStyle.Butt;
     _lineJoin    = LineJoinStyle.Miter;
     _dashPattern = new DashPattern();
     _opacity     = 1.0f;
     _miterLimit  = 10.0f;
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the Bytescout.PDF.SolidPen class.
        /// </summary>
        /// <param name="color">A Bytescout.PDF.Color that indicates the color of the pen.</param>
        public SolidPen(Color color)
        {
            if (color == null)
            {
                throw new ArgumentNullException();
            }

            _width       = 1;
            _color       = color;
            _lineCap     = LineCapStyle.Butt;
            _lineJoin    = LineJoinStyle.Miter;
            _dashPattern = new DashPattern();
            _opacity     = 1.0f;
            _miterLimit  = 10.0f;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the Bytescout.PDF.ColoredTilingPen class.
        /// </summary>
        /// <param name="width" href="http://msdn.microsoft.com/en-us/library/system.single.aspx">The width of pattern cells in pixels.</param>
        /// <param name="height" href="http://msdn.microsoft.com/en-us/library/system.single.aspx">The height of pattern cells in pixels.</param>
        public ColoredTilingPen(float width, float height)
        {
            if (width < 0)
            {
                throw new ArgumentOutOfRangeException("width");
            }
            if (height < 0)
            {
                throw new ArgumentOutOfRangeException("height");
            }

            _pattern     = new ColoredTilingPatternColorspace(width, height);
            _width       = 1;
            _lineCap     = LineCapStyle.Butt;
            _lineJoin    = LineJoinStyle.Miter;
            _dashPattern = new DashPattern();
            _opacity     = 1.0f;
            _miterLimit  = 10.0f;
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the Bytescout.PDF.SolidPen class.
        /// </summary>
        /// <param name="color">A Bytescout.PDF.Color that indicates the color of the pen.</param>
        /// <param name="width" href="http://msdn.microsoft.com/en-us/library/system.single.aspx">The width of the pen.</param>
        public SolidPen(Color color, float width)
        {
            if (color == null)
            {
                throw new ArgumentNullException("color");
            }
            if (width < 0)
            {
                throw new ArgumentOutOfRangeException("width");
            }

            _width       = width;
            _color       = color;
            _lineCap     = LineCapStyle.Butt;
            _lineJoin    = LineJoinStyle.Miter;
            _dashPattern = new DashPattern();
            _opacity     = 1.0f;
            _miterLimit  = 10.0f;
        }
Example #6
0
 public virtual void set_Renamed(State state)
 {
     this.scene = state.scene;
     //UPGRADE_ISSUE: Method 'java.awt.geom.AffineTransform.setTransform' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtgeomAffineTransformsetTransform_javaawtgeomAffineTransform_3"'
     //TODO PENDING this.transform.setTransform(state.transform);
     this.font                      = state.font;
     this.strokeColor               = state.strokeColor;
     this.fillColor                 = state.fillColor;
     this.fillBrush                 = state.fillBrush;
     this.lineWidth                 = state.lineWidth;
     this.lineCap                   = state.lineCap;
     this.lineJoin                  = state.lineJoin;
     this.miterLimit                = state.miterLimit;
     this.lineDashLengths           = state.lineDashLengths;
     this.lineDashPhase             = state.lineDashPhase;
     this.fillRule                  = state.fillRule;
     this.textPosition              = state.textPosition;
     this.usesFractionalFontMetrics = state.usesFractionalFontMetrics;
 }
Example #7
0
        public void polylineSetStyle(int contextId, float width, LineCapStyle cap, LineJoinStyle join,
                                     float miterLimit, float[] lineDashLengths, float lineDashPhase)
        {
            Scenic.Render.Context context = getContext(contextId);

            context.lineWidth       = width;
            context.lineCap         = cap;
            context.lineJoin        = join;
            context.miterLimit      = miterLimit;
            context.lineDashLengths = new List <float>();
            if (lineDashLengths != null)
            {
                for (int i = 0; i < lineDashLengths.GetLongLength(0); i++)
                {
                    context.lineDashLengths.Add(lineDashLengths[i]);
                }
            }
            context.lineDashPhase = lineDashPhase;
        }
Example #8
0
 protected virtual void strokeLineSegment(LineSegment segment1, LineSegment segment2, LineJoinStyle joinStyle, bool joinOnLeft)
 {
     //Draw Linsegment
     if (segment1 == null) return;
     fillConvexPolygon(segment1);
     //Draw join
     if (segment2 == null) return;
     Vector2 joinEndPoint = joinOnLeft ? segment1.LeftEndPoint : segment1.RightEndPoint;
     Vector2 joinStartPoint = joinOnLeft ? segment2.LeftStartPoint : segment2.RightStartPoint;
     switch (joinStyle)
     {
         case LineJoinStyle.Miter:
             fillConvexPolygon(joinEndPoint, segment1.EndPoint, joinStartPoint);
             break;
         case LineJoinStyle.Bevel:
         case LineJoinStyle.Round:
         default:
             throw new System.NotImplementedException();
     }
 }
Example #9
0
 /// <summary>
 /// Constructor for <see cref="LineJoinOperator"/>.
 /// </summary>
 /// <param name="style">The line join style to use.</param>
 public LineJoinOperator(LineJoinStyle style)
 {
     Style = style;
 }
Example #10
0
 public void SetLineJoin(LineJoinStyle join)
 {
     GetCurrentState().JoinStyle = join;
 }
Example #11
0
        public void polylineSetStyle(int contextId, float width, LineCapStyle cap, LineJoinStyle join,
            float miterLimit, float[] lineDashLengths, float lineDashPhase)
        {
            Scenic.Render.Context context = getContext(contextId);

            context.lineWidth = width;
            context.lineCap = cap;
            context.lineJoin = join;
            context.miterLimit = miterLimit;
            context.lineDashLengths = new List<float>();
            if (lineDashLengths != null)
            {
                for (int i = 0; i < lineDashLengths.GetLongLength(0); i++)
                    context.lineDashLengths.Add(lineDashLengths[i]);
            }
            context.lineDashPhase = lineDashPhase;
        }