示例#1
0
        public void UpdateSVG(XmlTextWriter doc, SVGContext context)
        {
            this.center = context.fxy(this.center);
            this.cd1    = context.fxy(this.cd1);
            this.cd2    = context.fxy(this.cd2);
            double  introduced4 = Convert.ToDouble(decimal.Subtract(this.cd1.X, this.center.X));
            double  num2        = Math2.Distance(introduced4, Convert.ToDouble(decimal.Subtract(this.cd1.Y, this.center.Y)));
            double  introduced5 = Convert.ToDouble(decimal.Subtract(this.cd2.X, this.center.X));
            double  num3        = Math2.Distance(introduced5, Convert.ToDouble(decimal.Subtract(this.cd2.Y, this.center.Y)));
            decimal introduced6 = decimal.Subtract(this.cd1.Y, this.center.Y);
            double  num         = Math.Atan(Convert.ToDouble(decimal.Divide(introduced6, decimal.Subtract(this.cd1.X, this.center.X)))) * 57.295779513082323;

            doc.WriteStartElement("ellipse");
            doc.WriteAttributeString("cx", this.center.X.ToString());
            doc.WriteAttributeString("cy", this.center.Y.ToString());
            doc.WriteAttributeString("rx", num2.ToString());
            doc.WriteAttributeString("ry", num3.ToString());
            doc.WriteAttributeString("transform", "rotate(" + num.ToString() + " " + this.center.X.ToString() + " " + this.center.Y.ToString() + ")");
            context.PrintEdge(doc);
            doc.WriteAttributeString("fill", context.fill);
            if (context.isClip & !String.IsNullOrEmpty(context.CurrClipID))//if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0))
            {
                doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")");
            }
            doc.WriteFullEndElement();
        }
示例#2
0
 public void UpdateSVG(XmlTextWriter doc, SVGContext context)
 {
     try
     {
         this.topleft     = context.fxy(this.topleft);
         this.bottomright = context.fxy(this.bottomright);
         if (decimal.Compare(this.bottomright.Y, this.topleft.Y) < 0)
         {
             int num = Convert.ToInt32(this.topleft.Y);
             this.topleft.Y     = this.bottomright.Y;
             this.bottomright.Y = new decimal(num);
         }
         doc.WriteStartElement("rect");
         doc.WriteAttributeString("x", this.topleft.X.ToString());
         doc.WriteAttributeString("y", this.topleft.Y.ToString());
         doc.WriteAttributeString("width", Math.Abs(decimal.Subtract(this.bottomright.X, this.topleft.X)).ToString());
         doc.WriteAttributeString("height", Math.Abs(decimal.Subtract(this.bottomright.Y, this.topleft.Y)).ToString());
         context.PrintEdge(doc);
     }
     finally
     {
         doc.WriteAttributeString("fill", context.fill);
         //if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0))
         if (context.isClip & context.CurrClipID != "")
         {
             doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")");
         }
         doc.WriteFullEndElement();
     }
 }
示例#3
0
 public void UpdateSVG(XmlTextWriter doc, SVGContext context)
 {
     try
     {
         string[] strArray = new string[(this.points.Length - 1) + 1];
         int      num2     = strArray.Length - 1;
         for (int i = 0; i <= num2; i++)
         {
             strArray[i] = context.fx(Convert.ToDouble(this.points[i].X)).ToString() + "," + context.fy(Convert.ToDouble(this.points[i].Y)).ToString();
         }
         if (context.interiorstyle == 3)
         {
             context.getHatch(doc);
         }
         doc.WriteStartElement("polygon");
         doc.WriteAttributeString("points", string.Join(" ", strArray));
         doc.WriteAttributeString("fill", context.fill);
         doc.WriteAttributeString("fill-rule", "evenodd");
         context.PrintEdge(doc);
     }
     finally
     {
         if (context.isClip & !String.IsNullOrEmpty(context.CurrClipID)) //if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0))
         {
             doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")");
         }
         doc.WriteFullEndElement();
     }
 }
示例#4
0
 public void UpdateSVG(XmlTextWriter doc, SVGContext context)
 {
     this.center = context.fxy(this.center);
     doc.WriteStartElement("circle");
     doc.WriteAttributeString("cx", this.center.X.ToString());
     doc.WriteAttributeString("cy", this.center.Y.ToString());
     doc.WriteAttributeString("r", context.fscale((double)this.radius).ToString());
     context.PrintEdge(doc);
     doc.WriteAttributeString("fill", context.fill);
     if (context.isClip & !String.IsNullOrEmpty(context.CurrClipID))//if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0))
     {
         doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")");
     }
     doc.WriteEndElement();
 }
示例#5
0
        public void UpdateSVG(XmlTextWriter doc, SVGContext context)
        {
            bool   flag  = true;
            string str   = "";
            string sLeft = "M";
            string str5  = "M";
            int    num3  = this.points.Length - 1;

            for (int i = 0; i <= num3; i++)
            {
                if (flag)
                {
                    str5 = sLeft;
                    if (sLeft == "L" && !flag)
                    {
                        str5 = "M";
                    }
                    this.strokepath = this.strokepath + string.Format("{0}{1}{2},{3}", new object[] { str, str5, context.fx(Convert.ToDouble(this.points[i].X)), context.fy(Convert.ToDouble(this.points[i].Y)) });
                }
                this.path = this.path + string.Format("{0}{1}{2},{3}", new object[] { str, sLeft, context.fx(Convert.ToDouble(this.points[i].X)), context.fy(Convert.ToDouble(this.points[i].Y)) });
                switch (this.flags[i])
                {
                case 0:
                    str   = "";
                    sLeft = "L";
                    flag  = false;
                    break;

                case 1:
                    str   = "";
                    sLeft = "L";
                    flag  = true;
                    break;

                case 2:
                    str   = "Z";
                    sLeft = "M";
                    flag  = false;
                    break;

                case 3:
                    str   = "Z";
                    sLeft = "M";
                    flag  = true;
                    break;
                }
            }
            this.path = this.path + "Z";
            if (context.interiorstyle == 3)
            {
                context.getHatch(doc);
            }
            doc.WriteStartElement("g");
            if (context.isClip & !String.IsNullOrEmpty(context.CurrClipID)) //if (context.isClip & (StringType.StrCmp(context.CurrClipID, "", false) != 0))
            {
                doc.WriteAttributeString("clip-path", "url(#" + context.CurrClipID + ")");
            }
            doc.WriteStartElement("path");
            doc.WriteAttributeString("d", this.path);
            doc.WriteAttributeString("fill", context.fill);
            doc.WriteAttributeString("fill-rule", "evenodd");
            doc.WriteAttributeString("stroke", "none");
            doc.WriteFullEndElement();
            doc.WriteStartElement("path");
            doc.WriteAttributeString("d", this.strokepath);
            doc.WriteAttributeString("fill", "none");
            context.PrintEdge(doc);
            doc.WriteFullEndElement();
            doc.WriteFullEndElement();
        }