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.Windows.Forms;
  9. using System.Drawing.Drawing2D;
  10. using System.Drawing.Imaging;
  11.  
  12. namespace WindowsFormsApplication1
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20.  
  21. private void button1_Click(object sender, EventArgs e)
  22. {
  23. this.ClientSize = new Size(
  24. Convert.ToInt32(textBox1.Text),
  25. Convert.ToInt32(textBox2.Text));
  26. string path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
  27. Bitmap bmp = new Bitmap(
  28. this.ClientSize.Width,
  29. this.ClientSize.Height,
  30. PixelFormat.Format32bppArgb);
  31. FormBorderStyle f = this.FormBorderStyle;
  32. this.FormBorderStyle = FormBorderStyle.None;
  33. this.DrawToBitmap(bmp, new Rectangle(0, 0, this.ClientSize.Width, this.ClientSize.Height));
  34. bmp.Save(path + "\\test.png", ImageFormat.Png);
  35.  
  36. this.FormBorderStyle = f;
  37. }
  38. }
  39. }
  40.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty