Example #1
0
        public override void Draw(System.Drawing.Graphics G)
        {
            SFPoint P1, P2;
            Color   RealColor = DXFConst.EntColor(this, Converter.FParams.Insert);

            P1 = Converter.GetPoint(Point1);
            P2 = Converter.GetPoint(Point2);
            if (FVisible)
            {
                G.DrawLine(new Pen(RealColor, 1), P1.X, P1.Y, P2.X, P2.Y);
            }
        }
Example #2
0
        public override void Draw(Graphics G)
        {
            SFPoint P1;
            Color   RealColor = DXFConst.EntColor(this, Converter.FParams.Insert);

            if (RealColor == DXFConst.clNone)
            {
                RealColor = Color.Black;
            }
            P1 = this.Converter.GetPoint(point);
            float h1 = height * Converter.FScale;

            P1.Y = P1.Y - h1;
            SolidBrush br1 = new SolidBrush(RealColor);
            Font       f1  = new Font("Times New Roman", h1);

            if (FVisible)
            {
                /*GraphicsContainer c1 = G.BeginContainer();
                 * if(rotation != 0)
                 * {
                 *      string str = string.Empty;
                 *      SizeF textSize = SizeF.Empty;
                 *      PointF textLocation = new PointF(P1.X, P1.Y); //PointF.Empty;
                 *      StringFormat strfmt = new StringFormat();
                 *      str = text;
                 *      //strfmt.FormatFlags = StringFormatFlags.DirectionVertical;
                 *      Size ClientSize = new Size((int) G.VisibleClipBounds.Width, (int) G.VisibleClipBounds.Height);
                 *      textSize = G.MeasureString(str, f1, ClientSize, strfmt);
                 *      textLocation = new Point(ClientSize.Width / 2, ClientSize.Height / 4);
                 *      RectangleF rectFSrc = new RectangleF(PointF.Empty, textSize);
                 *      RectangleF rectFDest = new RectangleF(new PointF(textLocation.X + textSize.Width, textLocation.Y + textSize.Height / 2), textSize);
                 *      GraphicsContainer container = G.BeginContainer(rectFDest, rectFSrc, GraphicsUnit.Pixel);
                 *      G.RotateTransform(rotation);
                 *      G.DrawString(str, f1, br1, PointF.Empty, strfmt);
                 *      strfmt.Dispose();
                 * } else G.DrawString(text, f1, br1, P1.X, P1.Y);
                 * G.EndContainer(c1); */
                if (rotation == 90)
                {
                    G.DrawString(text, new Font("Times New Roman", h1),
                                 br1, P1.X - h1, P1.Y - (text.Length * h1 / 1.6f),
                                 new StringFormat(StringFormatFlags.DirectionVertical));
                }
                else
                {
                    G.DrawString(text, new Font("Times New Roman", h1), br1, P1.X, P1.Y);
                }
            }
        }
Example #3
0
        public override void Draw(Graphics G)
        {
            SFPoint P1;
            float   rd1 = radius;

            P1   = Converter.GetPoint(Point1);
            rd1  = rd1 * Converter.FScale;
            P1.X = P1.X - rd1;
            P1.Y = P1.Y - rd1;
            Color RealColor = DXFConst.EntColor(this, Converter.FParams.Insert);

            if (FVisible)
            {
                G.DrawEllipse(new Pen(RealColor, 1), P1.X, P1.Y, rd1 * 2, rd1 * 2);
            }
        }
Example #4
0
        public override void Draw(Graphics G)
        {
            SFPoint P1;
            float   rd1, rd2;

            if (radPt.X == 0)
            {
                rd1 = Math.Abs(radius * ratio);
                rd2 = radius;
            }
            else
            {
                rd1 = radius;
                rd2 = Math.Abs(radius * ratio);
            }
            P1   = Converter.GetPoint(Point1);
            rd1  = rd1 * Converter.FScale;
            rd2  = rd2 * Converter.FScale;
            P1.X = P1.X - rd1;
            P1.Y = P1.Y - rd2;
            Color RealColor = DXFConst.EntColor(this, Converter.FParams.Insert);

            if (RealColor == DXFConst.clNone)
            {
                RealColor = Color.Black;
            }
            float sA = startAngle, eA = endAngle;

            //if(endAngle < startAngle) sA = Conversion_Angle(sA);
            eA -= sA;
            if (FVisible)
            {
                if (eA == 0)
                {
                    G.DrawEllipse(new Pen(RealColor, 1), P1.X, P1.Y, rd1 * 2, rd2 * 2);
                }
                else
                {
                    G.DrawArc(new Pen(RealColor, 1), P1.X, P1.Y, rd1 * 2, rd2 * 2, 0, 360);                     //sA, eA);
                }
            }
        }
Example #5
0
        public override void Draw(Graphics G)
        {
            SFPoint P1;
            float   rd1 = radius;

            P1   = Converter.GetPoint(Point1);
            rd1  = rd1 * Converter.FScale;
            P1.X = P1.X - rd1;
            P1.Y = P1.Y - rd1;
            Color RealColor = DXFConst.EntColor(this, Converter.FParams.Insert);
            float sA = -startAngle, eA = -endAngle;

            if (endAngle < startAngle)
            {
                sA = Conversion_Angle(sA);
            }
            eA -= sA;
            if (FVisible)
            {
                G.DrawArc(new Pen(RealColor, 1), P1.X, P1.Y, rd1 * 2, rd1 * 2, sA, eA);
            }
        }