Hello,
I have a problem when I try to print a Chart with an added text with this function: "Chart2->Canvas->TextOut3D()".
The printed Chart are the same that the Chart preview but the text are more bigger! I try to fix the size with:
Chart1->Canvas->Font->Size =8;
Chart1->Canvas->TextWidth (txt);
Chart1->Canvas->TextHeight (txt);
And it doesn't work. Anyone have a solution for it?
Many thanks.
Text print problem
-
- Advanced
- Posts: 103
- Joined: Tue Mar 02, 2004 5:00 am
- Location: Bad Wurzach
- Contact:
Hi Bob,
could you please read the following txt file which talks about how to print better ? and if you still having problems let me know.
You can download the file from our newsgroups at : news://www.steema.net/steema.public.attachments , there's a message with the subject "Printing Better".
could you please read the following txt file which talks about how to print better ? and if you still having problems let me know.
You can download the file from our newsgroups at : news://www.steema.net/steema.public.attachments , there's a message with the subject "Printing Better".
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Advanced
- Posts: 103
- Joined: Tue Mar 02, 2004 5:00 am
- Location: Bad Wurzach
- Contact:
Hi Pep,
I read the txt file which talks about how to print better and it don't talk about my problem. The document talk about "wysiwyg" (what you see is what you get) but in the print preview I can see the font in a small size, and when try to print all the image are the same of preview except the text, that's more and more bigger! I hope that you (or someone) can give me with another solution.
Thanks for your help.
I read the txt file which talks about how to print better and it don't talk about my problem. The document talk about "wysiwyg" (what you see is what you get) but in the print preview I can see the font in a small size, and when try to print all the image are the same of preview except the text, that's more and more bigger! I hope that you (or someone) can give me with another solution.
Thanks for your help.
Hi,
There are couple of possibilities:
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 Heigh 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):
There are couple of possibilities:
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;
Pep Jorge
http://support.steema.com
http://support.steema.com