コード例 #1
0
 /// <summary>
 /// Paints tree
 /// </summary>
 /// <param name="g"></param>
 /// <param name="p">Represents vertex of the tree</param>
 public static void Paint(Graphics g, Point p)
 {
     IsoTriangle.Paint(g, p, Brushes.ForestGreen, TRI_H, TRI_W);
     IsoTriangle.Paint(g, new Point(p.X, p.Y + (TRI_H / 2)), Brushes.ForestGreen, TRI_H, TRI_W);
     IsoTriangle.Paint(g, new Point(p.X, p.Y + TRI_H), Brushes.ForestGreen, TRI_H, TRI_W);
     g.FillRectangle(Brushes.Brown, new Rectangle(p.X - TRI_W / 4, p.Y + 2 * TRI_H, TRI_W / 2, TRI_H));
 }
コード例 #2
0
        public static void Paint(Graphics g, Point p, Brush b, int Height, int Width)
        {
            int x1 = avg(p.X, p.X + Width / 2);
            int y1 = avg(p.Y, p.Y + Height / 2);

            Chimney.Paint(g, new Rectangle(p.X + Width / 6, p.Y + Height - Height * 5 / 4, Width / 6, Height * 5 / 4));
            Smoke.Paint(g, new Rectangle(p.X + Width / 6, p.Y + Height - Height * 3 / 2, Width / 6, Width / 12));
            Smoke.Paint(g, new Rectangle(p.X + Width / 6, p.Y + Height - Height * 7 / 4, Width / 6, Width / 12));
            Smoke.Paint(g, new Rectangle(p.X + Width / 6, p.Y + Height - Height * 2, Width / 6, Width / 12));

            IsoTriangle.Paint(g, p, b, Height, Width);
        }