我有一个小应用程序,应该能够打印单个JPEG文件到网络打印机。现在,打印本身工作,但问题是打印机只打印图片的左上角四分之一,无论我使用哪张图片。通常情况下,图片是1800x1200像素和JPEG格式。
使用打印的代码IM如下:
protected void Button5_Click(object sender, EventArgs e)
{
PrintDocument doc = new PrintDocument();
doc.PrinterSettings.PrinterName = "KONICA MINOLTA C250/C250P PCL";
doc.PrintPage += this.Doc_PrintPage;
if(doc.PrinterSettings.IsValid)
doc.Print();
}
private void Doc_PrintPage(object sender, PrintPageEventArgs e)
{
float x = e.MarginBounds.Left;
float y = e.MarginBounds.Top;
e.Graphics.DrawImage((System.Drawing.Image)ShowImg(bild.ToolTip),x, y);
}
的ShowImg()函数只返回与从网络驱动器的图象的位图。 有谁知道为什么会发生这种奇怪的行为?
在此先感谢 Xen的