111,097
社区成员




Graphics graphic = this.panelView.CreateGraphics();
Size s = panelView.Size;
memImage = new Bitmap(s.Width, s.Height, graphic);
Graphics memGraphic = Graphics.FromImage(memImage);
IntPtr dc1 = graphic.GetHdc();
IntPtr dc2 = memGraphic.GetHdc();
BitBlt(dc2, 0, 0, panelView.ClientRectangle.Width, panelView.ClientRectangle.Height,
dc1, 0, 0, 13369376);
Image print_image = (Image)memImage.Clone();
graphic.ReleaseHdc(dc1);
memGraphic.ReleaseHdc(dc2);
graphic.Dispose();
memGraphic.Dispose();
PrintPreviewDialog dlg = new PrintPreviewDialog();
dlg.Width = 800;
dlg.Height = 600;
dlg.Document = printDocument1;
if (dlg.ShowDialog() == DialogResult.OK)
printDocument1.Print();