DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TPrintPreview

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
BAPBAP
Member


Joined: 26 Apr 2003
Posts: 1
Location: Russia

PostPosted: 26/04/03 12:23    Post subject: TPrintPreview Reply with quote

hi!
The TPrintPreview is fine! Tiny and usefull.
Can I scalled on the Paper some TPanel with all controls within? I try to do it but application seen to be fault if panel consist more then one control within... I use PaintWinControl. Thanks for any advices
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 208

PostPosted: 27/04/03 12:50    Post subject: Reply with quote

Hi,

To fix the bug, please look for the following line

Code:
WinControl.PaintTo(Bitmap.Canvas.Handle, 0, 0);

in the PaintWinControlEX method of TPrintPreview (Line No. 1381) and replace it with this one

Code:
WinControl.PaintTo(Bitmap.Canvas, 0, 0);


Thanks,
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
rgesswein
Member


Joined: 21 May 2003
Posts: 2

PostPosted: 21/05/03 21:00    Post subject: Reply with quote

Is this still valid? I noticed this change was not in the later releases?
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 208

PostPosted: 21/05/03 21:42    Post subject: Reply with quote

You are right. The above code is only valid for Delphi 6 or later.
Back to top
View user's profile Send e-mail Visit poster's website
Alex
Member


Joined: 04 Sep 2003
Posts: 4

PostPosted: 04/09/03 08:42    Post subject: Problem when print and fastprint=false Reply with quote

Hi Kambiz, I have two problem with TPrintPreview.
1. After release 4.17 when I change the printer resolution, change the size of font in the preview

2. In the new release when fastprint=false, generate an exception.

thank you Alex

excuse me for my bad english.
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 208

PostPosted: 05/09/03 00:28    Post subject: Reply with quote

Hi Alex,

1. The PixelPerInch property of the font depends on resolution of the device. In the older versions of TPrintPreview this dependency was not considered.

Code:
procedure TFont.SetSize(Value: Integer);
begin
  Height := -MulDiv(Value, FPixelsPerInch, 72);
end;

2. Can you please save the preview in a file and post it here. Having it will be helpful to figure out the problem. Of course, I do suggest instead of setting the FastPrint property to False, to use PaintGraphic or PaintGraphicEx methods to draw images and leave the FastPrint property as True. In this way, not only the print process is faster but also it will prevent out of resource problem that may occur on Windows 98 for high resolution prints.

Cheers,
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
Alex
Member


Joined: 04 Sep 2003
Posts: 4

PostPosted: 05/09/03 07:25    Post subject: TPrintPreview Reply with quote

Thank you so much Kambiz, Smile
I post the file "PrintPreview.doc" but it save with TPrintPreview. The real name id PrintPreview.ppv.
For more information I can send the source code.

Cheers
Alex



PrintPreview.ppv
 Description:
PrintPreview.ppv

Download
 Filename:  PrintPreview.ppv
 Filesize:  66.83 KB
 Downloaded:  22 Time(s)

Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 208

PostPosted: 05/09/03 12:32    Post subject: Reply with quote

I couldn't downlaod the file, because with .doc extension the mime type of file set to word document.

Can you upload the file with .ppv extension? I added this extension to the list allowed extensions.

Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
Alex
Member


Joined: 04 Sep 2003
Posts: 4

PostPosted: 05/09/03 13:47    Post subject: PrintPreview Reply with quote

Sorry i can't upload with ppv extension!!!
You are sure to enabled ppv extension? I upload with txt extension.
try again to download this file doing right click of the mouse on the attach file, and select "save target as...".

Alex
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 208

PostPosted: 05/09/03 14:40    Post subject: Reply with quote

I had added the extension but I had forgotten to activate it.

Because you didn't use any image in your report, you don't need to set FastPrint to False. As I already mentioned, it this way the print process is faster and the font qualility is also much better.

When you set the FastPrint property to False, TPrintPreview convert Metafile image of the page to device independent bitmap, and send this bitmap to the printer.

Probably you are using a high resolution printer on Windows 98, and because of that the DIB Bitmap size is bigger than what Windows 98 supports.

By the way, I removed you second attachment and changed the extension of the first one to ppv.

Regards,
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
Alex
Member


Joined: 04 Sep 2003
Posts: 4

PostPosted: 08/09/03 07:29    Post subject: TPRintPreview Reply with quote

Ok Kambiz, thank you for your attention.
Your component are the best component for delphi.

Regards
Alex
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 208

PostPosted: 08/09/03 11:38    Post subject: Reply with quote

Thank you.
This is so kind of you.
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products 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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group