BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

printing image of from

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Henry
Guest





PostPosted: Mon Jan 26, 2004 8:40 am    Post subject: printing image of from Reply with quote



I am trying to print an image of a form
here is my code:

Printer()->BeginDoc();
this->PaintTo(Printer()->Handle, 10, 10);
Printer->EndDoc();

this works, but it prints a very small image.
How can I set the size of the printed image.
Thanks


Back to top
Hans Galema
Guest





PostPosted: Mon Jan 26, 2004 9:15 am    Post subject: Re: printing image of from Reply with quote



Henry wrote:

Quote:
I am trying to print an image of a form
here is my code:

Printer()->BeginDoc();
this->PaintTo(Printer()->Handle, 10, 10);
Printer->EndDoc();

this works, but it prints a very small image.
How can I set the size of the printed image.

Yes, I have seen that before. Very small indeed.
The reason is that the resolution of your printer is much
higher than the resolution of your screen.

So in principle there are two solutions.
1. Tell your printer that it should pretend having
a much lower resolution. How to do that ? Never did that.

2. Untested:
Create an extra Graphics::TBitmap or a TCanvas and let your form
PaintTo() it. Then use CopyRect() to copy the bitmap/canvas to the
Printer()->Canvas. CopyRect() needs a source-rect and a destination-rect.
Make the dimensions of the destination-rect a multiple of the source-rect.
Copyrect will enlarge automatically.

Hans.

Back to top
Hans Galema
Guest





PostPosted: Mon Jan 26, 2004 10:30 am    Post subject: Re: printing image of from Reply with quote



Hans Galema wrote:

Quote:
So in principle there are two solutions.

3. Untested: If the complete TForm is visible on your screen you could just
use the TForm Canvas property like

Printer()->Canvas->CopyRect ( destination-rect, Canvas, source-rect );

with the destination rect a multiple of the sorce-rect.

Hans.

Back to top
Dennis Jones
Guest





PostPosted: Mon Jan 26, 2004 6:37 pm    Post subject: Re: printing image of from Reply with quote


"Hans Galema" <dontusethis (AT) dontusethis (DOT) nl> wrote

Quote:
Henry wrote:

I am trying to print an image of a form
here is my code:

Printer()->BeginDoc();
this->PaintTo(Printer()->Handle, 10, 10);
Printer->EndDoc();

this works, but it prints a very small image.
How can I set the size of the printed image.

Yes, I have seen that before. Very small indeed.
The reason is that the resolution of your printer is much
higher than the resolution of your screen.

So in principle there are two solutions.
1. Tell your printer that it should pretend having
a much lower resolution. How to do that ? Never did that.

2. Untested:
Create an extra Graphics::TBitmap or a TCanvas and let your form
PaintTo() it. Then use CopyRect() to copy the bitmap/canvas to the
Printer()->Canvas. CopyRect() needs a source-rect and a destination-rect.
Make the dimensions of the destination-rect a multiple of the source-rect.
Copyrect will enlarge automatically.

Or

3. Use the Win32 API functions designed to solve this problem. Perhaps this
is what you meant in your item (1). See the "Coordinate Space and
Transformation Functions" section of the Windows API help for functions such
as:

SetWindowOrgEx
SetWindowExtEx
SetViewportOrgEx
SetViewportExtEx
OffsetViewportOrgEx
OffsetWindowOrgEx
ScaleViewportExtEx
ScaleWindowExtEx

- Dennis



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.