TCircledSeries aspect ratio problem

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Aurelien
Newbie
Newbie
Posts: 1
Joined: Fri Feb 08, 2002 5:00 am
Contact:

TCircledSeries aspect ratio problem

Post by Aurelien » Mon Aug 01, 2005 9:37 am

hello,

i have already posted a message with attachments on the newsgroup public.teechart5.delphi.

i hope to have some help here :)

i have a problem with tcircledseries, with the circled property set to true.

under windows xp, no problem : the circle aspect is correct.

but under windows 2000 tse (terminal services), via a distant connection (remote desktop client), the circle aspect ratio is incorrect : circles have a greater height than width.

i have even tried the latest teechart 7 sample executable, the symptoms are the same.

i investigated a little, and the problem is located in series.pas, in tcircledseries.DoBeforeDrawValues procedure, in CalcCircledRatio sub-procedure.

just after the calcradius function call, there is a test affecting the fcirclerect values (left/right or top/bottom).

the ratio calculated here seem to be wrong in some cases...

what should i change here to get perfect ratio circles ?

thanks in advance for your time.

i am using delphi 6.240 with upd 2 and 3, teechart 5.02 pro with sources.

found the origin of the problem :
under windows xp (local session) :
GetDeviceCaps(ACanvas.Handle,HORZSIZE) returns 337 mm
and GetDeviceCaps(ACanvas.Handle,VERTSIZE) returns 270 mm

under windows 2000 tse (distant session) :
GetDeviceCaps(ACanvas.Handle,HORZSIZE) returns 320 mm
and GetDeviceCaps(ACanvas.Handle,VERTSIZE) returns 240 mm

but in this case, the monitor used to display the remote desktop is the same.
so the values returned by the API are for the windows 2000 server monitor (located in a special room).

so if i understand correctly, the aspect ratio is calculated for the computer on which the program is executed.
it should in fact be calculated for the monitor used to view the session (the local monitor for both the local session and the distant session).

but my knowledge is too limited to make my own workaround (except for using the same ratio as the one given to the function : screen.width / scren.height).

anyone has a tip to improve this ?

Post Reply