Printresolution

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Steve Sidwell
Newbie
Newbie
Posts: 5
Joined: Tue Jan 07, 2003 5:00 am
Location: Florida

Printresolution

Post by Steve Sidwell » Thu Feb 26, 2004 10:17 pm

What formula does TeeChart use to calculate font sizes for printing from
Printresolution?
I just want the font sizes on the printout to always be 10 point regardless
of screen size, printer resolution, physical output size etc.
I can't come up with a way of setting PrintResolution that will give me a
consistent printer font size for axes labels, title, legends etc.
Thanks

Steve Sidwell

Steve Sidwell
Newbie
Newbie
Posts: 5
Joined: Tue Jan 07, 2003 5:00 am
Location: Florida

Printresolution

Post by Steve Sidwell » Fri Feb 27, 2004 2:29 am

After a lot of trial and error this seems to work:

pixperinch := getdevicecaps(printer.handle, LOGPIXELSY);
factor := pixperinch / screen.PixelsPerInch;
w1 := (prect.Bottom - prect.Top);
w2 := round(aChart.height * factor);
aChart.PrintResolution := -(w1 - w2) * 100 div w2;
aChart.PrintPartialCanvas(printer.Canvas, prect);

The fonts always come out the same same now regardless of the size of the chart on screen, the size of the rectangle on the print canvas or the printer resolution.
Please can you confirm this is correct?

Thanks

Steve Sidwell

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Fri Feb 27, 2004 8:52 am

Hi, Steve.

The scaling is calculated internally in the TeeProcs.pas unit, more speficically, in the Procedure TCustomTeePanel.CalcMetaBounds and TCustomTeePanel.PrintPartialCanvas methods. The code you used is very close to the one we used. I've sent both methods sources to your email address.
Marjan Slatinek,
http://www.steema.com

achristouio
Newbie
Newbie
Posts: 26
Joined: Tue Apr 02, 2002 5:00 am
Location: University of Oslo
Contact:

Re: Printresolution

Post by achristouio » Tue Jan 30, 2007 2:34 pm

8439995 wrote:After a lot of trial and error this seems to work:

pixperinch := getdevicecaps(printer.handle, LOGPIXELSY);
factor := pixperinch / screen.PixelsPerInch;
w1 := (prect.Bottom - prect.Top);
w2 := round(aChart.height * factor);
aChart.PrintResolution := -(w1 - w2) * 100 div w2;
aChart.PrintPartialCanvas(printer.Canvas, prect);
I tried this on some plot with several fastline graphics, but, I got nice fonts on labels, but, the graphs got very thick and very little information visible compared to the window presentation.

I for my part want the resolution of the graphs as with printresolution -100, but axis, ticks and fonts unchanged, so I really miss a switch telling that rescaling with printresolution -100 should only be done with graphs, not with axis, tics, fonts etc.

Now -100 gives invisible fonts (font size 0.001 or alike)
:-(
We need this for scientific publications.
(Fonts should then be 12 pt, axis line thickness about 1/2-1 mm etc.

Please have a look at http://folk.uio.no/achristo/ActiCalc/gr ... lution.htm for more details

Pep
Site Admin
Site Admin
Posts: 3277
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Feb 05, 2007 4:45 pm

Hi,

one way to solve this could be by chaning the FontZoom and Pen width before do the print :

Chart1.View3DOptions.FontZoom:=200;
Chart1.Axes.Left.Ticks.Width:=2;

achristouio
Newbie
Newbie
Posts: 26
Joined: Tue Apr 02, 2002 5:00 am
Location: University of Oslo
Contact:

Post by achristouio » Mon Feb 05, 2007 4:52 pm

Pep wrote:Hi,

one way to solve this could be by chaning the FontZoom and Pen width before do the print :

Chart1.View3DOptions.FontZoom:=200;
Chart1.Axes.Left.Ticks.Width:=2;
Ok. I'll try that.

Post Reply