fork download
  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 WindowsFormsApplication1
  12.  
  13. public static Bitmap cropAtRect(this Bitmap b, Rectangle r)
  14. {
  15. Bitmap nb = new Bitmap(r.Width, r.Height);
  16. Graphics g = Graphics.FromImage(nb);
  17. g.DrawImage(b, -r.X, -r.Y);
  18. return nb;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(13,10): error CS1514: Unexpected symbol `public', expecting `.' or `{'
prog.cs(13,18): error CS1525: Unexpected symbol `Bitmap', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty