Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            String fileName = "nwc_" + System.DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".eps";
            EPSFile file = new EPSFile(fileName);
            NWCArt artwork = new NWCArt(file);

            #if false //draw the same thing at different orientations.
            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    double x = 25.0 * ((i+1)* (i+2) / 2.0);
                    double y = 25.0 * ((j+1) * (j+2) / 2.0);
                    double width = 25.0 * (i + 1);
                    double height = 25.0 * (j + 1);

                    GridSpace grid = new GridSpace( new Path( new Point2D(x,y),
                                                              //new Point2D(x+width*0.5, y + height * 0.1),
                                                              new Point2D(x + width, y ) ),
                                                    new Path( new Point2D(x, y + height),
                                                              new Point2D(x + width, y + height) ) );

                    artwork.DrawBox("lightgray", "none", grid);
                    artwork.DrawUformInBox("white","black",grid);
                }
            }
            #endif
            #if true   //odd quadrilateral.

            //            GridSpace grid2 = new GridSpace(new Point2D(100, 600),
            //                                                        new Point2D(500, 550),
            //                                                        new Point2D(250, 720),
            //                                                        new Point2D(500, 800));
            GridSpace grid2 = new GridSpace(new Point2D(0, 0),
                                            new Point2D(350, 0),
                                            new Point2D(0, 700),
                                            new Point2D(350, 700));
            artwork.DrawBox("lightgray", "none", grid2);
            artwork.DrawUformInBox("white","black",grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            grid2 = grid2.Inset(50, InsetType.Top); artwork.DrawUformInBox("none", "black", grid2);
            #endif
            #if false
            artwork.DrawSun(100, 10);
            #endif

            file.Close();

            System.IO.File.Copy(fileName, "latest.eps", true);
            System.IO.File.Move(fileName, ".\\archive\\" + fileName);
        }
        static void Main(string[] args)
        {
            String fileName = "nwc_" + System.DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".eps";
            EPSFile file = new EPSFile(fileName);

            //Black Uform - white uform - red double uform.
            {
                file.DrawPaths( "black",
                                new Path( 150,400,  190,500,  410,500,  450,400 ),
                                new Path( 450,400,  400,475,  200,475,  150,400 ) );

                file.DrawPaths("red",
                               new Path(150, 400, 200, 460, 282, 460, 300, 400),
                               new Path(300, 400, 150, 400) );

                file.DrawPaths("red",
                                new Path(300, 400, 318, 460, 400, 460, 450, 400),
                                new Path(450, 400, 300, 400));
            }

            //eye-ball
            {
                file.DrawPaths( "white", "black",
                                new Path(100,100,  115,115,  175,175,  425,175,  485,115,  500,100),
                                new Path(500,100,  485,85,  425,25,  175,25,  115,85,  100,100) );

                file.DrawOvoid("black",
                               new Path(165, 40, 165, 160, 435, 160, 435, 40) );
                file.DrawOvoid("white",
                               new Path(190, 65, 190, 160, 410, 160, 410, 65) );
                file.DrawOvoid("black",
                               new Path(215, 80, 215, 165, 385, 165, 385, 80) );
            }

            //red Uform - white split
            {
                file.DrawPaths( "red",
                                new Path(150, 500, 200, 700, 400, 700, 450, 500), //top
                                new Path(450, 501, 350, 511, 250, 511, 150, 501) ); //normal

                file.DrawPaths( "white",
                                new Path(450, 500, 350, 510, 250, 510, 150, 500),
                                new Path(150, 500, 175, 525, 275, 580, 300, 715 ),
                                new Path(300, 715, 325, 580, 425, 525, 450, 500 ) );
            }

            //Ovoid flatish on the bottom
            {
                file.DrawOvoid( "black",
                                new Path(150, 215, 175, 345, 425, 345, 450, 215) );
                file.DrawOvoid( "white",
                                new Path(175, 235, 200, 330, 400, 330, 425, 235) );
            }

            file.Close();

            System.IO.File.Copy(fileName, "latest.eps", true);
            System.IO.File.Move(fileName, ".\\archive\\" + fileName);
        }
Ejemplo n.º 3
0
 public NWCArt(EPSFile file)
 {
     m_file = file;
 }