Advertisement
Guest User

Untitled

a guest
Nov 9th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace JovanPanicTestGrupa2__2
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void button2_Click(object sender, EventArgs e)
  21. {
  22. pictureBox1.Image = null;
  23. }
  24.  
  25. private void button1_Click(object sender, EventArgs e)
  26. {
  27. Crtaj();
  28. }
  29.  
  30. private void Crtaj()
  31. {
  32. Graphics g = pictureBox1.CreateGraphics();
  33. SolidBrush cetka = new SolidBrush(Color.Blue);
  34. g.FillRectangle(cetka, 0, 0, 20, 20);
  35. g.FillRectangle(cetka, 30, 0, 20, 20);
  36. g.FillRectangle(cetka, 0, 30, 20, 20);
  37. g.FillRectangle(cetka, 30, 30, 20, 20);
  38.  
  39. g.FillRectangle(cetka, 50, 0, 100, 10);
  40.  
  41. g.FillRectangle(cetka, 50, 20, 100, 10);
  42.  
  43. g.FillRectangle(cetka, 50, 40, 100, 10);
  44.  
  45.  
  46. g.FillRectangle(cetka, 0, 60, 150, 10);
  47. g.FillRectangle(cetka, 0, 80, 150, 10);
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement