GDI+ Just won't die

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Metman
Advanced
Posts: 113
Joined: Fri Dec 21, 2007 12:00 am

GDI+ Just won't die

Post by Metman » Thu Jun 19, 2014 11:44 am

Hi

I am reworking an old application that has 5 charts in a gridpanel component. I hook each of the charts to a GDI+ component and set active true and anti-aliasing off. When working on the design in the IDE I noticed that anti-aliasing was now on in the charts, even when it wasn't set.

I then set each of the GDI+ components to active but it made no difference, so I deleted all the GDI+ components but the anti-aliasing is still active without any GDI+ component both in the IDE and at run-time :( .

I haven't had time to look at the new bug tracker yet, but I wonder if this problem has been logged?

Bruce.

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

Re: GDI+ Just won't die

Post by Yeray » Thu Jun 19, 2014 11:51 am

Hi Bruce,

The default canvas is now GDIPlus but you can go back to the regular GDI Canvas anytime:
http://www.teechart.net/support/viewtop ... 454#p62454
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

Metman
Advanced
Posts: 113
Joined: Fri Dec 21, 2007 12:00 am

Re: GDI+ Just won't die

Post by Metman » Thu Jun 19, 2014 12:47 pm

Hi Yeray

Thanks for the advice.

GDI is a bit confusing and there's very little help or guidance in the documentation either.

Do I understand it that GDI is always enabled?

Bruce.

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

Re: GDI+ Just won't die

Post by Yeray » Thu Jun 19, 2014 1:31 pm

Hi Bruce,
Metman wrote:GDI is a bit confusing and there's very little help or guidance in the documentation either.

Do I understand it that GDI is always enabled?
TeeChart VCL supports three Canvas: GDI, GDIPlus and OpenGL
TeeChart 2013.09 moved the default Canvas from GDI to GDIPlus (see the What's New page). This is for new charts being created while the charts already present in old forms should keep their choice.
However, you can still:
  • Change the current chart's canvas:
    • Through the editor at the "Chart/3D/Render" tab:
      2014-06-19_1542.png
      2014-06-19_1542.png (8.26 KiB) Viewed 21600 times
    • By code
      To set GDI by code:

      Code: Select all

      uses TeCanvas;
      
      procedure TForm1.FormCreate(Sender: TObject);
      begin
        Chart1.Canvas:=TTeeCanvas3D.Create;
      end;
      To set GDIPlus by code:

      Code: Select all

      uses TeeGDIPlus;
      procedure TForm1.FormCreate(Sender: TObject);
      begin
        Chart1.Canvas:=TGDIPlusCanvas.Create;
      end;
  • Change the option for the next new charts to be created at the "New Chart" tab in the "Options..." dialog opened from the contextual menu at design time::

    Image
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

Metman
Advanced
Posts: 113
Joined: Fri Dec 21, 2007 12:00 am

Re: GDI+ Just won't die

Post by Metman » Thu Jun 19, 2014 2:06 pm

Hi Yeray

Thanks that's a lot clearer.

I think it would be preferable to set GDI in code and stop cluttering the design view with TTeeGDIPlus components like you suggest, but just how do I set Antialias=false and AntiAliasText=gpfClearType in code?

Bruce.

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

Re: GDI+ Just won't die

Post by Yeray » Thu Jun 19, 2014 3:00 pm

Hello Bruce,

Find attached a project that shows you how to change both the Canvas and the font AntiAlias by code:
Font_Quality_Test.zip
(1.76 MiB) Downloaded 1447 times
Also, here you'll find an example showing the alternatives supported for the AntiAlias in the canvas.
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

cssesuc
Newbie
Newbie
Posts: 44
Joined: Wed Apr 08, 2015 12:00 am

Re: GDI+ Just won't die

Post by cssesuc » Wed Sep 09, 2015 3:53 pm

thanks it helped a lot.
thanks,
Nabil Ghodbane (PhD. Habil)

nbp
Newbie
Newbie
Posts: 15
Joined: Fri Apr 01, 2016 12:00 am

Re: GDI+ Just won't die

Post by nbp » Wed Dec 07, 2016 10:46 pm

What is the snippet of code to use the GDI renderer for C++ ActiveX component? (instead of GDIPlus).

i.e. I want to set Chart canvas to GDI instead of the default which is GDIPlus in TChart2016 ActiveX

Regards
--nbp

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: GDI+ Just won't die

Post by Sandra » Fri Dec 09, 2016 3:14 pm

Hello nbp,

I have answered you in that thread.

Thanks in advance
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply