Esempio n. 1
0
 public void Draw(IPixelSet pixelSet, IDrawingArea drawingArea)
 {
     this.pixelSet    = pixelSet;
     this.drawingArea = drawingArea;
     if (afterClick)
     {
         if (list == null)
         {
             list = new List <Point>();
             if (!afterMove)
             {
                 thread = new Thread(Fill)
                 {
                 };
                 thread.Start();
             }
             else
             {
                 Fill();
                 drawingArea.Redraw();
             }
         }
         else
         {
             DrawStack(pixelSet);
         }
     }
 }
Esempio n. 2
0
 public void Fill(int x, int y)
 {
     if (!pixelSet.CellIsInArea(x, y))
     {
         return;
     }
     if (pixelSet.IsNotFilled(x, y))
     {
         lock (list)
             list.Add(new Point(x, y));
         pixelSet.AddPoint(x, y);
         if (!afterMove)
         {
             drawingArea.Redraw();
             thread.Join(5);
         }
     }
     else
     {
         return;
     }
     Fill(x + 1, y);
     Fill(x - 1, y);
     Fill(x, y + 1);
     Fill(x, y - 1);
 }
Esempio n. 3
0
 public void Draw(IPixelSet pixelSet, IDrawingArea drawingArea)
 {
     this.pixelSet = pixelSet;
     this.drawingArea = drawingArea;
     if (afterClick)
         if (list == null)
         {
             list = new List<Point>();
             if (!afterMove)
             {
                 thread = new Thread(Fill) {};
                 thread.Start();
             }
             else
             {
                 Fill();
                 drawingArea.Redraw();
             }
         }
         else
         {
             DrawStack(pixelSet);
         }
 }