printing - How to print clearly contents of panel (basically labels) to printer in C# WinForms -


i have code printing panel printer. has labels , labels thing want print. works when prints, labels doesn't print clearly. blurred or something.

private void btnprint_click(object sender, eventargs e) {       print(panel1); }  public void print(panel pnl) {         pannel = pnl;         getprintarea(pnl);          if (cmbprinter.selectedindex != -1)         {             printdoc1.printersettings.printername = cmbprinter.selecteditem.tostring();         }          if (batchform.printinbatch)             printdoc1.print();         else         {             previewdlg.document = printdoc1;             previewdlg.showdialog();         } }  public void getprintarea(panel pnl) {         memoryimage = new bitmap(pnl.width, pnl.height);         rectangle rect = new rectangle(0, 0, pnl.width, pnl.height);         pnl.drawtobitmap(memoryimage, new rectangle(0, 0, pnl.width, pnl.height)); }  protected override void onpaint(painteventargs e) {         if (memoryimage != null)         {             e.graphics.drawimage(memoryimage, 0, 0);             base.onpaint(e);         } }  public void printdoc1_printpage(object sender, printpageeventargs e) {         rectangle pagearea = e.pagebounds;         e.graphics.drawimage(memoryimage, 0, 0); } 


Comments