/// <summary>
 /// 计算八卦坐标并生成八卦实体
 /// </summary>
 /// <param name="point">圆心坐标</param>
 /// <param name="totalWidth">八卦爻的总宽度</param>
 /// <param name="midWidth">如果是阴爻的话,中间的宽度</param>
 /// <param name="heigth">每一个爻 的宽度</param>
 /// <param name="r"></param>
 public BaguaCoordinateSystem(PointF point, int totalWidth, int midWidth, int heigth, float r = 300)
 {
     XianTianBaGua = new List <DanGua>();
     HouTianBaGua  = new List <DanGua>();
     TotalWidth    = totalWidth;
     Heigth        = heigth;
     MidWidth      = midWidth;
     GuaRectangle  = DanGua.GetGuaRectangle(totalWidth, heigth, midWidth);
     CircleCenter  = point;
     R             = r;
     this.GetBaGuaDirectionPoint();
     this.GetBaGuaList();
 }
Beispiel #2
0
        public void DanGua_Graphics(DanGua danGua)
        {
            Image image = new Bitmap(400, 400);

            Graphics graph = Graphics.FromImage(image);

            graph.Clear(Color.Azure);
            Pen pen = new Pen(Brushes.Red);

            graph.DrawRectangles(pen, danGua.RectangleList.ToArray());
            graph.FillRectangles(Brushes.Red, danGua.RectangleList.ToArray());
            graph.DrawString(danGua.Name, new Font("ËÎÌå", 12), Brushes.Red, new PointF(danGua.GuaRectangle.Width + 20, danGua.GuaRectangle.Height / 2));
            image.Save("graph_" + danGua.Name + ".bmp", System.Drawing.Imaging.ImageFormat.Bmp);
        }
Beispiel #3
0
 /// <summary>
 /// 计算八卦坐标并生成八卦实体
 /// </summary>
 /// <param name="point">圆心坐标</param>
 /// <param name="totalWidth">八卦爻的总宽度</param>
 /// <param name="midWidth">如果是阴爻的话,中间的宽度</param>
 /// <param name="heigth">每一个爻 的宽度</param>
 /// <param name="r"></param>
 /// <param name="ISS">默认为南向坐标系</param>
 public BaguaCoordinateSystem(PointF point, int totalWidth, int midWidth, int heigth, int r = 300, bool ISS = true)
 {
     XianTianBaGua              = new List <DanGua>();
     HouTianBaGua               = new List <DanGua>();
     XianTianBaGuYaoRectangleF  = new List <YaoRectangleF>();
     HoutTianBaGuaYaoRectangleF = new List <YaoRectangleF>();
     TotalWidth   = totalWidth;
     Heigth       = heigth;
     MidWidth     = midWidth;
     GuaRectangle = DanGua.GetGuaRectangle(totalWidth, heigth, midWidth);
     CircleCenter = point;
     R            = r;
     this.GetBaGuaDirectionPoint();
     this.GetBaGuaList(ISS);
     //求出图上的一起始点
     this.GetGuaStartPointF();
     this.GetGuaYaoRectangleF(ISS);
 }