示例#1
0
 public FigurePainter(Brush brush, IFormFigure formFigure, Point startPoint, AbstractFilling typeOfFilling)
 {
     this.brush         = brush;
     this.formFigure    = formFigure;
     this.startPoint    = startPoint;
     this.typeOfFilling = typeOfFilling;
 }
示例#2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     formCanvas.currentBitmap         = new Bitmap(pictureBox1.Width, pictureBox1.Height);
     formCanvas.tmpBitmap             = new Bitmap(pictureBox1.Width, pictureBox1.Height);
     pictureBoxCurrentColor.BackColor = Color.Black;
     currentFilling = new NoneFilling(currentColor);
 }
示例#3
0
        public override AbstractPainter CreatePainter(IFormFigure currentFigure, Color currentColor, int currentSize, Point startPoint, AbstractFilling typeOfFilling)
        {
            Brush brush = new Brush(currentColor, currentSize);

            abstractPainter = new FigurePainter(brush, currentFigure, startPoint, typeOfFilling);

            return(abstractPainter);
        }
示例#4
0
 private void buttonOnlyBorders_Click(object sender, EventArgs e)
 {
     currentFilling = new NoneFilling(currentColor);
 }
示例#5
0
 private void buttonFigureWithBorders_Click(object sender, EventArgs e)
 {
     fillingColor   = pictureBoxPrevColor.BackColor;
     currentFilling = new InsideFilling(fillingColor);
 }
示例#6
0
 private void buttonOnlyFigure_Click(object sender, EventArgs e)
 {
     currentFilling = new TotalFilling(currentColor);
 }
示例#7
0
 abstract public AbstractPainter CreatePainter(IFormFigure currentFigure, Color currentColor, int currentSize, Point startPoint, AbstractFilling typeOfFilling);
示例#8
0
 public VectorFigurePainter(Brush brush, IFormFigure formFigure, Point startPoint, AbstractFilling typeOfFilling)
 {
     this.brush         = brush;
     this.formFigure    = formFigure;
     this.startPoint    = startPoint;
     this.typeOfFilling = typeOfFilling;
     points             = formFigure.CalculateFigure(startPoint, startPoint);
 }