What TChart.Canvas class is being used?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

What TChart.Canvas class is being used?

Post by TestAlways » Fri Aug 08, 2014 2:07 pm

For a long time, I had the following code:

Code: Select all

  Assert(aChart.Canvas is TGDIPlusCanvas, 'Chart canvas class should be TGDIPlusCanvas but is ' + aChart.Canvas.ClassName);
  aChart.Canvas := TTeeCanvas3D.Create;
  try
  ...
  finally
    aChart.Canvas := TGDIPlusCanvas.Create;
  end;
This code gets called a lot (used to create an image of a chart for reporting). But a few days ago the Assert fired.

How can I know what class is used by default for the TChart.Canvas object?

Ed Dressel

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

Re: What TChart.Canvas class is being used?

Post by Yeray » Fri Aug 08, 2014 3:03 pm

Hi Ed,

The default Canvas is the one you have selected in the "Render" combobox at the "New Chart" tab at the design time options. Note this option is saved at the registry entry:

Code: Select all

HKEY_CURRENT_USER\Software\Steema Software\TeeChart Pro\Editor\DefaultCanvas
- a blank string '' is the value set for the GDI canvas.
- 'TGDIPlusCanvas' is the value set for GDI+.
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

Post Reply