fork download
  1. using System;
  2. using System;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. using System.Drawing.Drawing2D;
  6. using System.Linq;
  7. using System.Collections.Generic;
  8.  
  9.  
  10. //pb[i].Image = Image.FromFile("C:\\Users\\4\\source\\repos\\WindowsFormsApp\\WindowsFormsApp\\cat.bmp");
  11.  
  12. class Sample : Form
  13. {
  14. private Image img;
  15.  
  16.  
  17. public static void Main()
  18. {
  19. Application.Run(new Sample());
  20. }
  21.  
  22. public Sample()
  23. {
  24. this.Text = "Sample";
  25. this.Width = 700; this.Height = 700;
  26. this.BackColor = Color.MintCream;
  27.  
  28.  
  29. img = Image.FromFile("C:\\Users\\4\\source\\repos\\WindowsFormsApp\\WindowsFormsApp\\cat.bmp");
  30.  
  31. this.Paint += new PaintEventHandler(fm_Paint);
  32. }
  33.  
  34. public void fm_Paint(object sender,PaintEventArgs e)
  35. {
  36. Graphics g = e.Graphics;
  37. GraphicsPath gp = new GraphicsPath();
  38.  
  39. gp.AddEllipse(new Rectangle(0, 0, 400, 300));
  40. Region rg = new Region(gp);
  41. g.Clip = rg;
  42.  
  43. g.DrawImage(img, 0, 0, 700, 700);
  44. }
  45. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(2,1): warning CS0105: The using directive for `System' appeared previously in this namespace
prog.cs(4,22): error CS0234: The type or namespace name `Forms' does not exist in the namespace `System.Windows'. Are you missing `System.Windows.Forms' assembly reference?
prog.cs(12,16): error CS0246: The type or namespace name `Form' could not be found. Are you missing an assembly reference?
prog.cs(34,40): error CS0246: The type or namespace name `PaintEventArgs' could not be found. Are you missing an assembly reference?
Compilation failed: 3 error(s), 1 warnings
stdout
Standard output is empty