Winapi DrawText on chart no longer use canvas settings

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
athely
Newbie
Newbie
Posts: 10
Joined: Mon Mar 13, 2017 12:00 am

Winapi DrawText on chart no longer use canvas settings

Post by athely » Tue Dec 19, 2017 1:20 pm

Hi,

Since i've upgrade my RAD from D2009 to XE10.1 and Teechart from 8.08 to 2017.10, DrawText function (from winapi unit) no longer use canvas settings as font color, size, etc...
Same function on TImage canvas works fine!
TestTChartDrawFunction.png
TestTChartDrawFunction.png (65.07 KiB) Viewed 17936 times
Please find attached small project highlighting problem.
I use Delphi XE10.1 and TeeChart Pro VCL FMX Source Code 2017.20.

Thanks for your help

Anthony
Attachments
TestTChartLDrawText - XE10.1.zip
(25.96 KiB) Downloaded 1260 times

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Winapi DrawText on chart no longer use canvas settings

Post by Yeray » Wed Dec 20, 2017 2:18 pm

Hello Anthony,

It works as always if you switch back from GDIPlus to GDI:

Code: Select all

uses TeCanvas;
//...
  Chart.Canvas:=TTeeCanvas3D.Create;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

athely
Newbie
Newbie
Posts: 10
Joined: Mon Mar 13, 2017 12:00 am

Re: Winapi DrawText on chart no longer use canvas settings

Post by athely » Thu Dec 21, 2017 3:07 pm

Ok thank, it works finein GDI mode!

Is it planned to fix problem in GDIPlus?

Anthony

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Winapi DrawText on chart no longer use canvas settings

Post by Marc » Thu Dec 28, 2017 9:48 am

Hello Anthony,

We don't have this listed to modify for GDI+. There is the alternative approach using TeeChart's own TextOut.

eg.

Code: Select all

Chart.Canvas.Font.Color := clred;
  Chart.Canvas.Font.Size := 15;
  Chart.Canvas.TextOut(r.Left,r.Top,str);
You'd need to add some code to divide up your lines at the spaces.

Regards,
Marc Meumann
Steema Support

odaumas
Newbie
Newbie
Posts: 16
Joined: Tue Feb 18, 2020 12:00 am

Re: Winapi DrawText on chart no longer use canvas settings

Post by odaumas » Wed May 20, 2020 1:03 pm

Hello anyone,
Back to this problem.
The use of DrawText being much more powerful than the use of TextOut, isn't the correction of this regression planned yet ?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Winapi DrawText on chart no longer use canvas settings

Post by Marc » Tue Jun 23, 2020 10:30 am

Hello,

When using GDI+, TeeChart uses the GDI+ DrawString method internally.

Regards,
Marc Meumann
Steema Support

Post Reply