c# - Printing Creates an Dialogbox and I dont want that -


creating print option screenshot of form needed whole form sure. leads additional printing dialog box printout.

here code,

private void printdocument1_printpage(object sender, system.drawing.printing.printpageeventargs e){   var scr = screen.frompoint(this.location);         using (var bmp = new bitmap(scr.workingarea.width, scr.workingarea.height))         {             using (var gr = graphics.fromimage(bmp))             {                 gr.copyfromscreen(new point(scr.workingarea.left, scr.workingarea.top), point.empty, bmp.size);             }             // determine scaling             float scale = 1.0f;             scale = math.min(scale, (float)e.marginbounds.width / bmp.width);             scale = math.min(scale, (float)e.marginbounds.height / bmp.height);             // set scaling , offset             e.graphics.translatetransform(e.marginbounds.left + (e.marginbounds.width - bmp.width * scale) / 2,                                           e.marginbounds.top + (e.marginbounds.height - bmp.height * scale) / 2);             e.graphics.scaletransform(scale, scale);             // , draw             e.graphics.drawimage(bmp, 0, 0); 

}

which displays dialogbox shown below, problem area

please me in issue... in advance...

add printdocument1.printcontroller = new standardprintcontroller() before call printdocument1.print() default believe uses printcontrollerwithstatusdialog.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -