locked
Printing a WinForm in good quality RRS feed

  • Question

  • User259356331 posted

    Hi everyone,

    I have a problem printing a win form in a good quality.

    I use the follwoing code in the PrintPage event:

    Bitmap bmp = new Bitmap(this.Widht,this.Height,16bppFormat);

    this.drawToBitmap(bmp , new Rectangle (0,0,this.Widht,this.Height));

    e.Graphics.DrawImage(0,0,new Point(0,0));

    I get the image of the entire form but it is not in sharp quality.

    For example, I have   a certain image on  the form. When I print the captured form , which has an image on it, (using the above code) I get it not in such sharp quality as I would get it when printing the same image with the IE browser.

    I don't know why the IE has much better quality where I can see small details of the image whereas printing the same image in WinForms  i don't get the same quality as in IE.

    Does any one know a better way where I can capture the form (in winforms) and print it in the best quality possible?

    Thank you in advance,

    Mike.

     

     

    Sunday, January 4, 2009 7:31 AM

Answers

  • User1796367390 posted

    Hi Mike,

    Would suggest you ask your question at http://windowsclient.net/Forums/ as this forum is for ASP.net.

    However, from memory do you need to set the SmoothingMode of your Graphics object to AntiAlias to get a better quality image. Also you could try using the PrintDialog control (if you are not already) and play around with some of the print settings there before printing.

    Hope that helps,

    Ben

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, January 4, 2009 8:37 AM