Page 1 of 1

GDI+ Just won't die

Posted: Thu Jun 19, 2014 11:44 am
by 10047857
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.

Re: GDI+ Just won't die

Posted: Thu Jun 19, 2014 11:51 am
by yeray
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

Re: GDI+ Just won't die

Posted: Thu Jun 19, 2014 12:47 pm
by 10047857
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.

Re: GDI+ Just won't die

Posted: Thu Jun 19, 2014 1:31 pm
by yeray
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 19577 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

Re: GDI+ Just won't die

Posted: Thu Jun 19, 2014 2:06 pm
by 10047857
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.

Re: GDI+ Just won't die

Posted: Thu Jun 19, 2014 3:00 pm
by yeray
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 1187 times
Also, here you'll find an example showing the alternatives supported for the AntiAlias in the canvas.

Re: GDI+ Just won't die

Posted: Wed Sep 09, 2015 3:53 pm
by 16573450
thanks it helped a lot.

Re: GDI+ Just won't die

Posted: Wed Dec 07, 2016 10:46 pm
by 16677938
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

Re: GDI+ Just won't die

Posted: Fri Dec 09, 2016 3:14 pm
by 10050769
Hello nbp,

I have answered you in that thread.

Thanks in advance