void pd_PrintPage(object sender, PrintPageEventArgs e)
{
Image temp = pictureBox1.Image;
int x = e.MarginBounds.X;
int y = e.MarginBounds.Y;
int width = temp.Width;
int height = temp.Height;
Rectangle destRect = new Rectangle(x, y, width, height);
e.Graphics.DrawImage(temp, destRect, 0, 0, temp.Width, temp.Height, System.Drawing.GraphicsUnit.Pixel);
}
private void button1_Click(object sender, EventArgs e)
PrintPreviewDialog ppd = new PrintPreviewDialog(); 铝条板吊顶
PrintDocument pd = new PrintDocument();
防盗电子狗
Margins margin = new Margins(20, 20, 20, 20);
pd.DefaultPageSettings.Margins = margin;
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
ppd.Document = pd;
ppd.ShowDialog();
try
{
}金玻璃
catch (Exception ex)
{
矩阵切换
MessageBox.Show(ex.Message, "打印出错", MessageBoxButtons.OK, MessageBoxIcon.Error);
pd.PrintController.OnEndPrint(pd, new PrintEventArgs());
}
}