Quantcast
Channel: Printing of images(WPF)
Viewing all articles
Browse latest Browse all 4

Printing of images(WPF)

$
0
0

Hallo,

I want to print an image from type Windows.Control or Windows.Drawing. If i print the image directly via the following code, the image will be blurred. If i convert it to an PDF by ‘Microsoft PDF Converter’ and then print, the image will be clearer. What can I do that the image will be clearer if I print directly (sending to printer without converting)?


 PrintDocument pd = new PrintDocument();
 pd.PrintPage += Pd_PrintPage;
 pd.Print();

 private void Pd_PrintPage(object sender, PrintPageEventArgs e)
    {

      var pd = sender as PrintDocument;
      Rectangle m = new Rectangle(10,10, (int)pd.PrinterSettings.DefaultPageSettings.PrintableArea.Height-10, (int)pd.PrinterSettings.DefaultPageSettings.PrintableArea.Width-10);
      e.Graphics.DrawImage(image, m);
    }


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images