namespace WindowsApplication
{
    public partial class Form4 : Form
    {   
        
        public Form4()
        {
            InitializeComponent();
        }        private void button1_Click(object sender, EventArgs e)
        {
            CaptureScreen();
            printDialog1.Document = printDocument1;
            DialogResult result = printDialog1.ShowDialog();
            if (result == DialogResult.OK)
                printDocument1.Print();   
        }
        Bitmap memoryimage;      
        private void CaptureScreen()
        {
            Graphics mygraphics = this.CreateGraphics();  //
            mygraphics.DrawEllipse(Pens.Black, 50, 50, 200, 200);             mygraphics.DrawLine(Pens.Black, 150, 140, 140, 170); 
            mygraphics.DrawArc(Pens.Black, 110, 100, 85, 110, 45, 85);
            Size s = this.Size;
            memoryimage = new Bitmap(s.Width, s.Height, mygraphics);下面俩句是啥意思?干啥用的》
            Graphics g = Graphics.FromImage(memoryimage);
            g.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);
        }
        
        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawImage(memoryimage, 0, 0);
        }
    }
}