This is an old topic for us, but:
The quality of printed TCharts is not very good (at least for line drawings), apparently because TChart does not maintain object sizes and proportions independent of resolution. There are other similar TChart-to-printer issues also, such as annotation placements.
We would like to exploit the high resolutions available on printers, yet still maintain the relative proportions between font sizes, other objects, and chart dimensions, as seen on the display. Line weights and detail should follow the device resolutions. A line width of 1 on the screen should be a width of 1 on the printer (i.e, much finer), but a 10 pt font on the screen should be a 10 pt font on the printer.
If our printer canvas is 4800 x 6000, and we create a metafile of a TChart onto a rect this size, the fonts, tick marks, and other ojects become unreadable, yet the chart dimensions remain as defined.
Are there global properties that we can use to, say, scale all fonts on the chart upward to match the new chart size? Has v8 provided a solution?
Thanks
Kevin
Print Quality
-
- Newbie
- Posts: 58
- Joined: Mon May 17, 2004 4:00 am
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello everyone,
I recommend you to read the article about printing I posted here.
If it doesn't help don't hesitate to let us know.
I recommend you to read the article about printing I posted here.
If it doesn't help don't hesitate to let us know.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Thanks, but this doesn't help. It merely points out old solutions, and acknowledges the problem.
How about a response to the original question?
How to access all objects in the TChart that need scaling (fonts, text boxes, etc.) so we can scale them onto the metafile canvas according to the canvas size?
Is there a list of annotations, for example?
A list of Fonts?
Note that this issue also occurs with a simple change of paper size (A4 vs A3, for example).
Kevin
How about a response to the original question?
How to access all objects in the TChart that need scaling (fonts, text boxes, etc.) so we can scale them onto the metafile canvas according to the canvas size?
Is there a list of annotations, for example?
A list of Fonts?
Note that this issue also occurs with a simple change of paper size (A4 vs A3, for example).
Kevin
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Kevin,
Sorry for the delayed reply.
1) If you're printing text, have you used Font.Height instead of Font.Size for font "size" ? This is important because if you are "painting" canvas to printer.canvas then you must use Font.Height (negative value!) to define font "size". Something like this:
For more on Height vs. Size check Delphi help file.
2) The problem is all custom positioned object (rectangles, text, series marks) use screen pixels coordinates. While this is fine for screen it does not work for printer. Why ? The reason for this is if you print, TeeChart will internally change chart size (so that it fits in specified printer.Canvas region). The result is Chart size will change but the custom positioned items "positions" on printer canvas will remain the same (in screen pixel coordinates). This will result in custom items being drawn at wrong place. The solution : Ignore PrintPartialCanvas method and rather use the following method to print chart(s):
If this doesn't help don't hesitate to let us know.
Sorry for the delayed reply.
A solution to this issue is making the chart bigger before printing as Pep described on this thread.How about a response to the original question?
For printting you need to set font height instead of font size:How to access all objects in the TChart that need scaling (fonts, text boxes, etc.) so we can scale them onto the metafile canvas according to the canvas size?
1) If you're printing text, have you used Font.Height instead of Font.Size for font "size" ? This is important because if you are "painting" canvas to printer.canvas then you must use Font.Height (negative value!) to define font "size". Something like this:
Code: Select all
Chart1.Canvas.Font.Height := -11;
2) The problem is all custom positioned object (rectangles, text, series marks) use screen pixels coordinates. While this is fine for screen it does not work for printer. Why ? The reason for this is if you print, TeeChart will internally change chart size (so that it fits in specified printer.Canvas region). The result is Chart size will change but the custom positioned items "positions" on printer canvas will remain the same (in screen pixel coordinates). This will result in custom items being drawn at wrong place. The solution : Ignore PrintPartialCanvas method and rather use the following method to print chart(s):
Code: Select all
var tmpMeta: TMetaFile;
OldColor : TColor;
begin
Chart1.BevelOuter := bvNone;
OldColor := Chart1.Color;
Chart1.Color := clNone;
tmpMeta := Chart1.TeeCreateMetafile(true,Chart1.ClientRect);
try
Printer.Orientation := poLandscape;
Printer.BeginDoc;
try
Printer.Canvas.StretchDraw(Rect(1,1,Printer.PageWidth - 1,
Printer.PageHeight - 1),tmpMeta);
finally
Printer.EndDoc;
end;
finally
tmpMeta.Free;
Chart1.BevelOuter := bvRaised;
Chart1.Color := OldColor;
end;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hello,
I would like to show you a comparison about the print quality in TeeChart :
I have opened exactly the same points in TeeChartOffice and in another software I have. I printed both charts and scanned it so that we can clearly see the difference. For TeeChart, I used a Metachart, but I tried several methods and I can't have a better quality :
Unfortunately I have no idea how this other software handles printing. It was an old soft created about 10 years ago in C++. My customers ask me to improve the print quality, as they were used to this old software with a really good quality.
I tried many solutions to have the best quality possible with TeeChart (direct print, metachart, etc.), but I can't do better than the picture you see in this message.
My question is : do you think there is a way to reach such a good quality as the "Other printing" ? I can send you the data I used if it helps.
I would like to show you a comparison about the print quality in TeeChart :
I have opened exactly the same points in TeeChartOffice and in another software I have. I printed both charts and scanned it so that we can clearly see the difference. For TeeChart, I used a Metachart, but I tried several methods and I can't have a better quality :
Unfortunately I have no idea how this other software handles printing. It was an old soft created about 10 years ago in C++. My customers ask me to improve the print quality, as they were used to this old software with a really good quality.
I tried many solutions to have the best quality possible with TeeChart (direct print, metachart, etc.), but I can't do better than the picture you see in this message.
My question is : do you think there is a way to reach such a good quality as the "Other printing" ? I can send you the data I used if it helps.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bertrod,
You may be interested in reading the Printing better article I pointed in a previous reply.
Hope this helps!
You may be interested in reading the Printing better article I pointed in a previous reply.
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |