예제 #1
0
 // -------------------------------------------------        NewSet
 private void NewSet ()
 {
     polygons .Clear ();
     for (int nApex = 3; nApex < 12; nApex++)
     {
         Point ptC = new Point (notCloser + rand .Next (nSeed) % (ClientSize .Width - 2 * notCloser),
                                notCloser + rand .Next (nSeed) % (ClientSize .Height - 2 * notCloser));
         int radius = minRadius + rand .Next (nSeed) % 120;
         Point [] pts = Auxi_Geometry .RegularPolygon (nApex, ptC, radius, 0);
         Color [] clrs = Auxi_Colours .SmoothChangedColors (nApex, Auxi_Colours .ColorPredefined (nApex),
                                                                   Auxi_Colours .ColorPredefined (nApex + 1));
         ChatoyantPolygon poly = new ChatoyantPolygon (pts, ptC, clrs, Auxi_Colours .ColorPredefined (nApex + 2));
         polygons .Add (poly);
     }
 }
예제 #2
0
파일: Form_Main.cs 프로젝트: enildne/zest
        // -------------------------------------------------        OnLoad
        private void OnLoad (object sender, EventArgs e)
        {
            Auxi_Colours .VisibleFrame (this);

            plot = new MSPlot (this, new Rectangle (50, 60, 350, 290), Side .S, 0.0, 4 * Math .PI, GridOrigin .ByStep, Math .PI,
                                                                       Side .E, 1.0, -1.0, GridOrigin .ByStep, 0.5);
            plot .AddComment (0.5, -14, "Sin (x) * Cos (12x)", 
                              new Font ("Times New Roman", 11, FontStyle .Bold | FontStyle .Italic), 0, Color .Blue);

            piechart = new PieChart (this, new Point (500, 330), 140, Auxi_Common .RandomArray (1000, Auxi_Common .strDays .Length));
            piechart .SectorTexts = Auxi_Common .strDays;

            Font fnt = new Font ("Times New Roman", 14, FontStyle.Bold | FontStyle.Italic);
            house9 = new ApartmentHouse (new Rectangle (690, 110, 120, 210));
            house9 .HouseColor = Color .White;
            house9 .RoofColor = Color .Red;
            house9 .DoorColor = Color .Brown;
            house9 .WindowColor = Color .Cyan;

            house23 = new ApartmentHouse (new Rectangle (580, 90, 130, 110));
            house23 .HouseColor = Color .Yellow;
            house23 .RoofColor = Color .Green;

            Point ptC = new Point (100, 440);
            int radius = 50;
            Color [] clrs = Auxi_Colours .SmoothChangedColors (4, Auxi_Colours .ColorPredefined (4), Auxi_Colours .ColorPredefined (5));
            poly4 = new ChatoyantPolygon (Auxi_Geometry .RegularPolygon (4, ptC, radius, 0), ptC, clrs, Auxi_Colours .ColorPredefined (6));
            ptC = new Point (260, 460);
            radius = 75;
            clrs = Auxi_Colours .SmoothChangedColors (7, Auxi_Colours .ColorPredefined (7), Auxi_Colours .ColorPredefined (8));
            poly7 = new ChatoyantPolygon (Auxi_Geometry .RegularPolygon (7, ptC, radius, 0), ptC, clrs, Auxi_Colours .ColorPredefined (9));

            info = new TextM (this, new Point (plot .MainArea .Area .Right + 30, Convert .ToInt32 (poly4 .Center .Y) + 20), strInfo);
            info .BackColor = Color .FromArgb (255, 255, 128);

            ClientSize = new Size (Math .Max (info .Area .Right, house9 .Area .Right) + 20, info .Area .Bottom + 12);

            timerStart .Enabled = true;
            timerStart .Start ();

            RenewMover ();
        }
예제 #3
0
 // -------------------------------------------------        Click_btnAddChatPoly
 private void Click_btnAddChatPoly (object sender, EventArgs e)
 {
     int nApexes = Convert .ToInt32 (numericUD_ChatApexes .Value);
     int radius = 80;
     Point ptC = new Point (rand .Next (nSeed) % (ClientSize .Width - 2 * radius) + radius, 
                            rand .Next (nSeed) % (ClientSize .Height - 2 * radius) + radius);
     Point [] pts = new Point [nApexes];
     for (int j = 0; j < nApexes; j++)
     {
         double angle = 2 * Math .PI * j / nApexes;
         pts [j] = new Point (ptC .X + (int) (radius * Math .Cos (angle)), ptC .Y - (int) (radius * Math .Sin (angle)));
     }
     Color [] clrs = Auxi_Colours .SmoothChangedColors (nApexes, clrStart, clrEnd);
     ChatoyantPolygon poly = new ChatoyantPolygon (pts, ptC, clrs, clrChatPolyCenter);
     mover .Insert (iTopElemOrder, poly);  
     Invalidate ();
 }