Page 1 of 1

Turning off GDI+

Posted: Fri Jul 18, 2014 3:55 pm
by 16464432
Hello,

In our Delphi VCL TeeChart Pro environment we have tried to disable GDI+ because our end users have a single hardware platform and don't need the slower anti-aliased rendering that GDI+ provides.

To do so we set Render to GDI in the Chart Gallery and New Chart tabs of Tools/Options/Third Party/Teechart.

However, there is some action that our users are taking in the TChart Editor that seems to turn GDI+ back on.

Are there known cases where this can happen, and if so what are they? Is there a way for us to prevent this from occurring?

Thanks!
SND

Re: Turning off GDI+

Posted: Mon Jul 21, 2014 10:23 am
by 10050769
Hello SDE,

We haven't detected similar problems than your users experiencing with TChart Editor and GDI+. Could tell exactly what actions do your clients do, so we can try to reproduce the problems here?

Thanks in advance,

Re: Turning off GDI+

Posted: Mon Jul 21, 2014 10:04 pm
by 16464432
Hi,

After speaking to several more of our users, I am not sure that it is something that they are necessarily triggering in the Tee Chart Editor. So far it appears as though only those of us on the development team can create charts that look like they are GDI. All of our users are getting charts that look like GDI+.

Some more information that I can now share with you, though, is that after doing compares of the binary SaveToStream output between the charts that we the developers create and those our users are creating, I am finding mention of a DefaultCanvas getting set to TGDIPlusCanvas in our users' SaveToStream output that is not in the developer SaveToStream output. This is perfectly in line with what we are seeing, but I am very confused about how this is getting triggered for our users even though we have turned off GDI+. Could it be that you have features in the Tee Chart Editor that requires GDI+ in order to work so that you automatically switch to that if a user chooses certain options? Also, what could be different about our developer environment in Delphi that allows us to see GDI charts? If I do a LoadFromStream from one of my users, I too have GDI+ graphs, but when I create a chart from scratch, I don't.

TGDIPlus Canvas is in the TeeGDIPlus Unit and appears to have anti aliasing properties that might allow me to turn it off. However, right now I cannot access them because I have turned off GDI plus and removed that unit from my units. So how can I turn off the anti aliasing in my code so that my users have GDI charts? Why/how is this occurring?

Thanks,
SDE

Re: Turning off GDI+

Posted: Tue Jul 22, 2014 3:35 pm
by 10050769
Hello

We would like inform you that TeeChart 2014 moved the default Canvas from GDI to GDIPlus. It maybe cause the problem you are experiencing with GDI and GDI+.
Moreover, I have made a simple project where the save and load process for stream charts in GDI and GDI+ is done without problems. Could you please, check if my project works in your end?
Note that the project has done in Rad Studio XE6 and latest maintenance release of TeeChart Pro VCL/FMX 2014. If you don't use this environment, please tell me whicht IDE you are using and I will adapt the project for your IDE.
TemplateGDI+Test.zip
(62.09 KiB) Downloaded 850 times
Hoping it will help.
Thanks in advance,

Re: Turning off GDI+

Posted: Wed Jul 23, 2014 6:08 pm
by 16464432
Hi,

Thank you for your last post. We are using Delphi XE5. My development environment is on a separate secure network, so it is very difficult for me to pull your code into my environment or for me to share my code with you. However, I did take a look at your project and it does not quite address my main concern.

I don't doubt that your code works without problems or even that it will work on my end. But it does not help me understand why I can create charts with GDI as the default canvas but somehow my users have GDIPlus as their default canvas. Clearly something is triggering that change and my explicitly turning off GDIPlus in our development environment has no effect because something is overriding that.

My main problem is that GDIPlus charts are not crisp and take a lot of time to load. However, I believe that is directly a result of the anti-aliasing that is done in GDIPlus. Can I turn off anti-aliasing in GDIPlus and if so, how? Then I will try to work around this issue by turning on GDIPlus and then turning off the anti-aliasing.

Thanks!
SDE

Re: Turning off GDI+

Posted: Thu Jul 24, 2014 3:30 pm
by 10050769
Hello SDE,

Thanks for your information. We are investigating what cause the problem you are experiencing, we try to give an answer in short time as possible.

Thanks in advance,

Re: Turning off GDI+

Posted: Thu Jul 24, 2014 4:28 pm
by 16464432
Thank you very much for looking into this issue! I will wait for your response.

Re: Turning off GDI+

Posted: Tue Jul 29, 2014 2:53 pm
by 16464432
Hi,

It is my understanding that most of Europe goes on vacation for the month of August, including Steema. So I'm rather worried about how to resolve this problem to meet my production deadline which is also next month.

I appreciate you looking into the cause of the problem, but right now it would be really helpful if I had a workaround. That is, can you please advise me on how to turn off anti-aliasing when using GDI+?

Thanks,
SDE

Re: Turning off GDI+

Posted: Tue Jul 29, 2014 3:56 pm
by 10050769
Hello SDE,

Sorry for the delay. After investigating about the problem, I would like inform we have found an easy solution for you that allows you disable AntiAlias in GD+ canvas. To do it is only necessary you add a new GDI+ component, assign the chart panel to new GDI+ component and disable antialias. The code below shows as you need do:

Code: Select all

uses VCLTee.Series, VCLTee.TeCanvas;
var Series1: TLineSeries;
GDIComponent :TTeeGDIPlus;
procedure TForm2.AntiAliasCheckClick(Sender: TObject);
begin
GDIComponent.Antialias := AntiAliasCheck.Checked;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
      Series1 := TLineSeries.Create(Self);
      Chart1.AddSeries(Series1);
      GDIComponent := TTeeGDIPlus.Create(Self);
      Series1.FillSampleValues(50);
      Chart1.Canvas := TTeeCanvas3D.Create;
      GDIComponent.TeePanel := Chart1;
      GDIComponent.Active := True;
      GDIComponent.Antialias := False;
end;
Could you confirm it works in your end?

Hoping it will helps.

Thanks in advance,

Re: Turning off GDI+

Posted: Wed Jul 30, 2014 9:09 pm
by 16464432
Hi Sandra,

Thank you very much for that code. I used a variation in my program, and I think we have succeeded. I need to do a little more testing with some of my users but so far so good with respect to the look of the graphs.

I do think that the charting is still a little bit slower, so if you can still find an answer for how to keep gdi+ permanently turned off (rather than gdi+ on with antialias off), that would be the best solution. But until such a determination can be made, I think this will be acceptable for the time being.

In the mean time, one more question. In addition to TTeeGDIPlus.AntiAlias, there is TTeeGDIPlus.AntiAliasText. I understand that the graphics and text are controlled separately. Can you please describe what the different enumerated types are for AntiAliasText (i.e., gpfBest, gpfDefault, gpfClearType, gpfNormal). From experimentation, I know that gpfNormal seems to not use Antialiasing but I would like to know what your default is and what each of these enumerated types look like. I couldn't find a description in the Help.

Thanks for all of your help!
SDE

Re: Turning off GDI+

Posted: Fri Aug 01, 2014 3:05 pm
by 10050769
Hello SDE,
I do think that the charting is still a little bit slower, so if you can still find an answer for how to keep gdi+ permanently turned off (rather than gdi+ on with antialias off), that would be the best solution. But until such a determination can be made, I think this will be acceptable for the time being.
In the case you want use the GDI canvas instead of GDI+ canvas, you need only disable GDi+ canvas.
If you want do it by code you can do next:

Code: Select all

uses TeCanvas;
procedure TForm2.FormCreate(Sender: TObject);
begin
Chart1.Canvas := TTeeCanvas3D.Create;
end;
If you prefer do it in design time, please follow the steps below:
- Do click with right button and select Edit Chart
- Go to Chart->3D->Render select GDI canvas.
In the mean time, one more question. In addition to TTeeGDIPlus.AntiAlias, there is TTeeGDIPlus.AntiAliasText. I understand that the graphics and text are controlled separately. Can you please describe what the different enumerated types are for AntiAliasText (i.e., gpfBest, gpfDefault, gpfClearType, gpfNormal). From experimentation, I know that gpfNormal seems to not use Antialiasing but I would like to know what your default is and what each of these enumerated types look like. I couldn't find a description in the Help.
The TTeeGDIPlus.AntiAliasText options of TeeChart Pro VCL/FMs offer the same AntiAliasText options that gives GDI+, but simplifying these in four types. Please, take a look in the link to get more information.

Hoping it will help.

Thanks in advance,

Re: Turning off GDI+

Posted: Fri Aug 01, 2014 8:18 pm
by 16464432
Thank you very much, Sandra! Enjoy August :)

SDE

Re: Turning off GDI+

Posted: Mon Aug 04, 2014 12:03 pm
by 10050769
Hello SDE,

I am glad the solution have worked for you :).

Thanks in advance and enjoy the August, too ;).