DBAdvGDIPChartView SaveToImage

I upgraded to the latest release (not sure where I was before) and am now getting the following error "Incompatible types : 'TChartImageType' and 'TImageType' when running the following :
DBAdvGDIPChartView1.Panes[0].Chart.SaveToImage(item_name, 300 , 350, itJPEG, 100);
What has changed and how do I continue to save to a JPG file?

There might be references to itJPEG defined in multiple units for the chart you would need to prefix itJPEG:


Kind Regards, 

Thanks Pieter

Tried that, got 'Object or class type required'
[DBAdvGDIPChartView1.Panes[0].Chart.SaveToImage(item_name, 500 , 350, TChartImageType.itJPEG, 100);]
Also tried the following, which got the same result as my first post:
imgt: TChartImageType;
imgt := itJPEG;


Do you have the unit AdvGDIP and the AdvChartViewGDIP included ? Could your perhaps test with the following code:


 as a parameter.

Kind Regards, 

Hi Pieter

I did not have the unit  AdvGDIP included. I did include but am still getting "'Object or class type required'
Your demo AdvChartGDIPPieDemo.dpr is giving me same compiler error.
btw I am using Delphi 7

Sorry, correct unit name is AdvChartGDIP

Hi Bruno,

Already had unit AdvChartGDIP included.
Just to reiterate All was working 100% until I run the update?

We did not change anything in TMS Advanced Charts wrt the itJPEG type.

The cause of the problem is clarified at:
under "Problem with constants/type names declared in different units with the same name"

DBAdvGDIPChartView1.Panes[0].Chart.SaveToImage(item_name, 300 , 350, AdvChartViewGDIP.itJPEG, 100);

should work.

Hi Bruno

Wierd, I read and tried your suggestion. Actually ignoring my project and simply trying to get your demo working AdvChartGDIPPieDemo.dpr still getting the same result.

Also tried unistalling and reinstalling the Pack from scratch. No difference


Any assistance would be appreciated, my dev has come to a grinding halt.
Perhaps this will help. After commenting out the issue above I now have a problem with something else which appears related.
DBAdvGDIPChartView2.Panes[0].Series[0].GradientType := gtHorizontal;
  Error : Incompatible types : 'AdvChartViewGDIP.TChartGradientType' and 'DecayFrm.TChartGradientType'
(DecayFrm = form the component is on)
Taking your advise I made the change below and got the error that follows:
DBAdvGDIPChartView2.Panes[0].Series[0].GradientType := TChartGradientType.gtHorizontal;
  Error : Object or class type required

Cleared that last error by cleaning out the 'Uses' section on that form, so just the original error. Tried to clear out the Uses on that form as well, but did not help

I do not see any reason for such problem on a clean setup of Delphi and our components.
I'd suggest to first check this on a separate clean setup.

Test this with dropping a DBAdvGDIPChartView on the form and add the code:


procedure TForm4.FormCreate(Sender: TObject);
  DBAdvGDIPChartView1.Panes[0].Series[0].GradientType := TChartGradientType.gtHorizontal;

This compiles and works without any issue here.

Hi Bruno,

I appreciate the help. I cleared the Uses section again. Then I tried using the itPNG instead of itJpeg and it worked.
The really strange thing is after a compilation I then put the itJpeg back and all works again?

Sorry, but since I'm not overlooking every detail of what you are doing, I cannot comment on why it is working now. I tried to explain the technical reason behind the error you see and the solutions for the technical causes.