Pro výukové účely na SPŠ Zlín
vytvořil RNDr.Vladimír Vaščák

Grafika 2
  1. Button button3;
  2. Button button2;
  3. Button button1;
  4. PictureBox pictureBox1;

  1. private Graphics dc;
  2. public Form1() {
  3. InitializeComponent();
  4. dc = pictureBox1.CreateGraphics();
  5. }
  6.  
  7. private void button1_Click_1(object sender, EventArgs e) {
  8. Pen pero = new Pen(Color.Black, 4);
  9. SolidBrush stetec = new SolidBrush(Color.Yellow);
  10. dc.DrawEllipse(pero, 30, 30, 300, 300);
  11. dc.FillEllipse(stetec, 30, 30, 300, 300);
  12. }
  13.  
  14. private void button2_Click_1(object sender, EventArgs e) {
  15. Pen pero = new Pen(Color.Black, 4);
  16. SolidBrush stetec = new SolidBrush(Color.White);
  17. dc.DrawEllipse(pero, 80, 130, 30, 60);
  18. dc.FillEllipse(stetec, 80, 130, 30, 60);
  19. }
  20.  
  21. private void button3_Click_1(object sender, EventArgs e) {
  22. Pen pero = new Pen(Color.Black, 8);
  23. dc.DrawArc(pero, 80, 200, 200, 110, 0, 180);
  24. }

Uložit