C# 在c中通过PrintDocument打印时图像模糊#

C# 在c中通过PrintDocument打印时图像模糊#,c#,printdocument,C#,Printdocument,我正试图通过c#打印我的照片。我的打印机是爱普生L351。通过Windows picture viewer打印时,照片质量相当高。但是当我通过c#打印照片时,它只是保持模糊。照片大小为1286.76*1930.4。单击以获取图片 这是我的密码。我不知道这有什么问题。我是不是错过了一些设置打印机的东西 private void button1_Click(object sender, EventArgs e) { this.printDocument1.Printe

我正试图通过c#打印我的照片。我的打印机是爱普生L351。通过Windows picture viewer打印时,照片质量相当高。但是当我通过c#打印照片时,它只是保持模糊。照片大小为1286.76*1930.4。单击以获取图片

这是我的密码。我不知道这有什么问题。我是不是错过了一些设置打印机的东西

    private void button1_Click(object sender, EventArgs e)
    {
        this.printDocument1.PrinterSettings.PrinterName = "EPSON L350 Series";

        PaperSize ps = new PaperSize("Custom Size 1", 400, 600);
        this.printDocument1.DefaultPageSettings.PaperSize = ps;
        this.printDocument1.DefaultPageSettings.PrinterResolution = this.printDocument1.PrinterSettings.PrinterResolutions[0];           
        this.printDocument1.DefaultPageSettings.Landscape = false;
        this.printDocument1.DefaultPageSettings.Margins.Left = 0;
        this.printDocument1.DefaultPageSettings.Margins.Top = 0;
        this.printDocument1.DefaultPageSettings.Margins.Right = 0;
        this.printDocument1.DefaultPageSettings.Margins.Bottom = 0;
        this.printDocument1.Print();
    }

    private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
    {
        try
        {
            printDocument1.DocumentName = "Bonnie";

            Image newImage = Image.FromFile(@"C:\W (22).jpg");

            e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            e.Graphics.CompositingQuality = CompositingQuality.HighQuality;
            e.Graphics.DrawImage(newImage, 0, 0, 400, 600);

            printDocument1.Dispose();
            newImage.Dispose();
        }
        catch (Exception ex)
        {
        }
    }

希望得到你的帮助

我从来没有机会打印C#的图像,但我对我看到的400600维非常谨慎。这感觉就像是你在把你的分辨率降低到那些会导致你模糊的数字上。@LorenPechtel谢谢你的回答!数字400和600用于匹配纸张尺寸(4英寸*6英寸)。如果我使用
e.Graphics.DrawImage(newImage,0,0),它将只打印部分照片。换句话说,您的打印速度为100dpi。当然模糊了@LorenPechtel那么我如何将dpi设置为300?我的打印机的dpi似乎为300。正如我所说,我以前从未尝试过打印图像。我倾向于尝试1200x1800。