Ejemplo n.º 1
0
 private static void DrawOval(HSSFPatriarch patriarch)
 {
     // Create an oval and style to taste.
     HSSFClientAnchor a = new HSSFClientAnchor();
     a.SetAnchor((short)2, 2, 20, 20, (short)2, 2, 190, 80);
     HSSFSimpleShape s = patriarch.CreateSimpleShape(a);
     s.ShapeType = HSSFSimpleShape.OBJECT_TYPE_OVAL;
     s.SetLineStyleColor(10, 10, 10);
     s.SetFillColor(90, 10, 200);
     s.LineWidth = HSSFShape.LINEWIDTH_ONE_PT * 3;
     s.LineStyle = LineStyle.DotSys;
 }
Ejemplo n.º 2
0
        private static void DrawManyLines(HSSFPatriarch patriarch)
        {
            // Draw bunch of lines
            int x1    = 100;
            int y1    = 100;
            int x2    = 800;
            int y2    = 200;
            int color = 0;

            for (int i = 0; i < 10; i++)
            {
                HSSFClientAnchor a2 = new HSSFClientAnchor();
                a2.SetAnchor((short)2, 2, x1, y1, (short)2, 2, x2, y2);
                HSSFSimpleShape shape2 = patriarch.CreateSimpleShape(a2);
                shape2.ShapeType = (HSSFSimpleShape.OBJECT_TYPE_LINE);
                shape2.SetLineStyleColor(color);
                y1    -= 10;
                y2    -= 10;
                color += 30;
            }
        }