PC Review


Reply
Thread Tools Rate Thread

Confused about printing, pagebounds, and printer resolution

 
 
Chris Dunaway
Guest
Posts: n/a
 
      13th Apr 2006
When using PrintDocument to print something, if I check the PageBounds
property of the PrintPageEventArgs object, it shows the rectangle to be
850 x 1100, or 100 dpi. But when I check the value of the
PrintDocument.PrinterSettings.DefaultPageSettings.PrinterResolution.X
property for the printer in question it shows 600 dpi?

If I perform the following:

e.Graphics.FillRectangle(Brushes.Gainsboro, 40, 40, 500, 100);

in the PrintPage event, I get a gray rectangle that is exactly 5 inches
by 1 inch, or 100 dpi.

What is the relationship of the rectangle returned by the PageBounds
property to the dpi of the printer?

I tried changing the resolution of the printer but it still seemed to
print at 100 dpi.

Can anyone clear this up for me?

Thanks

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SW1nRGV2?=
Guest
Posts: n/a
 
      13th Apr 2006
Set the pageunit property in the PrintPage event - I have my data stored in
inches, so I set it like this:

e.Graphics.PageUnit = GraphicsUnit.Inch; // or whatever unit you want.

If you do this, you don't have to worry about the DPI of the printer.


"Chris Dunaway" wrote:

> When using PrintDocument to print something, if I check the PageBounds
> property of the PrintPageEventArgs object, it shows the rectangle to be
> 850 x 1100, or 100 dpi. But when I check the value of the
> PrintDocument.PrinterSettings.DefaultPageSettings.PrinterResolution.X
> property for the printer in question it shows 600 dpi?
>
> If I perform the following:
>
> e.Graphics.FillRectangle(Brushes.Gainsboro, 40, 40, 500, 100);
>
> in the PrintPage event, I get a gray rectangle that is exactly 5 inches
> by 1 inch, or 100 dpi.
>
> What is the relationship of the rectangle returned by the PageBounds
> property to the dpi of the printer?
>
> I tried changing the resolution of the printer but it still seemed to
> print at 100 dpi.
>
> Can anyone clear this up for me?
>
> Thanks
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing problem: How to change printer resolution? Lloyd Dupont Microsoft Dot NET Framework Forms 0 17th Feb 2006 02:32 AM
confused printer user =?Utf-8?B?cmhpbm8=?= Windows XP Print / Fax 1 25th Sep 2004 01:12 PM
Printing Graphics.PageBounds not accurate Gregg Walker Microsoft Dot NET Framework Forms 6 1st Sep 2004 03:45 PM
Juno printer confused harvey Printers 1 28th Oct 2003 08:17 PM
how to set printer resolution when printing graphics Philippe Microsoft VB .NET 2 16th Sep 2003 08:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:12 AM.