| View previous topic :: View next topic |
| Author |
Message |
BAPBAP Member
Joined: 26 Apr 2003 Posts: 1 Location: Russia
|
Posted: 26/04/03 12:23 Post subject: TPrintPreview |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 208
|
Posted: 27/04/03 12:50 Post subject: |
|
|
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 |
|
 |
rgesswein Member
Joined: 21 May 2003 Posts: 2
|
Posted: 21/05/03 21:00 Post subject: |
|
|
| Is this still valid? I noticed this change was not in the later releases?
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 208
|
Posted: 21/05/03 21:42 Post subject: |
|
|
| You are right. The above code is only valid for Delphi 6 or later.
|
|
| Back to top |
|
 |
Alex Member
Joined: 04 Sep 2003 Posts: 4
|
Posted: 04/09/03 08:42 Post subject: Problem when print and fastprint=false |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 208
|
Posted: 05/09/03 00:28 Post subject: |
|
|
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 |
|
 |
Alex Member
Joined: 04 Sep 2003 Posts: 4
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 208
|
Posted: 05/09/03 12:32 Post subject: |
|
|
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 |
|
 |
Alex Member
Joined: 04 Sep 2003 Posts: 4
|
Posted: 05/09/03 13:47 Post subject: PrintPreview |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 208
|
Posted: 05/09/03 14:40 Post subject: |
|
|
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 |
|
 |
Alex Member
Joined: 04 Sep 2003 Posts: 4
|
Posted: 08/09/03 07:29 Post subject: TPRintPreview |
|
|
Ok Kambiz, thank you for your attention.
Your component are the best component for delphi.
Regards
Alex
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 208
|
Posted: 08/09/03 11:38 Post subject: |
|
|
Thank you.
This is so kind of you.
|
|
| Back to top |
|
 |
|