none
winfrom打印的问题 RRS feed

  • 问题

  • 使用的printDocument控件,打印IC会员卡,使用的c#代码打印出来的照片清晰度非常差,而我用其他打印方式(比如:photoshop)就非常好,请问这是为什么?还有需要设置的吗? 

    this.printDocument1.DefaultPageSettings.Margins = new Margins(0, 0, 0, 0);
                this.printDocument1.DefaultPageSettings.Landscape = true;
                this.printDocument1.DefaultPageSettings.PrinterResolution.X = 600;
                this.printDocument1.DefaultPageSettings.PrinterResolution.Y = 600;
                this.printDocument1.OriginAtMargins = true;
                this.pageSetupDialog1.EnableMetric = true;
                this.pageSetupDialog1.ShowDialog();
                this.printDocument1.PrintPage += printDocument1_PrintPage;
                if (printPreviewDialog1.ShowDialog() != DialogResult.OK) return;
                this.printDocument1.Print();
    
    
    
    
    
            private async void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
            {
                await writeCardTask(e);
            }
    
            private async Task<bool> writeCardTask(PrintPageEventArgs e)
            {
                if (e == null) return false;
    
                //e.Graphics.DpiX
    
                #region 照片
    
                e.Graphics.DrawImage(Bitmap.FromFile(pic), 9, 70, 88, 108);
                #endregion
    
    
                return true;
            }

    2015年5月8日 8:07

答案