如题

解决方案 »

  1.   


     private void printToolStripMenuItem_Click(object sender, EventArgs e)
            {
                CaptureScreen();
                if (dlgPrint.ShowDialog() == DialogResult.OK)
                {
                   
                    printDocument.Print();
                }           
            }               private void CaptureScreen()
            {            Graphics mygraphics = pnlScale.CreateGraphics();            Size s = pnlScale.Size;            memoryImage = new Bitmap(s.Width, s.Height, mygraphics);            Graphics memoryGraphics = Graphics.FromImage(memoryImage);            IntPtr dc1 = mygraphics.GetHdc();            IntPtr dc2 = memoryGraphics.GetHdc();            BitBlt(dc2, 0, 0, pnlScale.ClientRectangle.Width, pnlScale.ClientRectangle.Height, dc1, 0, 0, 13369376);            mygraphics.ReleaseHdc(dc1);            memoryGraphics.ReleaseHdc(dc2);        }        private void printDocument_PrintPage(object sender, PrintPageEventArgs e)
            {
                e.Graphics.DrawImage(memoryImage, 0, 0, pnlScale.Size.Width, pnlScale.Size.Height);
            } 
    没有align属性的,以上是我的代码