Page 1 of 1

How to use Teegdiplus

Posted: Wed Oct 20, 2010 10:13 am
by 10546313
Hi,

I am using Teechart V8.07. How can I activate the gdiplus function ?

with best regards
Werner

Re: How to use Teegdiplus

Posted: Wed Oct 20, 2010 10:28 am
by narcis
Hi Werner,

There's an example at the new features demo at All Features\Welcome!\3D Canvas\GDI+ Canvas, the demo is available at TeeChart's program group.

Re: How to use Teegdiplus

Posted: Wed Oct 20, 2010 12:04 pm
by 10546313
Dear Narcis,

I have tried it, but I don't succeed at least.

In the function TGDIPLUSCanvas.GDPIColor I get a runtime error out of range.

I have modified with {$R-}, now the error disappeared, but the colors are not correct.
I have it tried on Xp and Win 7

with best regards
Werner

function TGDIPlusCanvas.GDIPColor(AColor:TColor):{$IFDEF CLR}Color{$ELSE}TColor{$ENDIF};
begin
AColor:=ColorToRGB(AColor);

{$IFDEF CLR}
result:=Color.FromArgb(AColor);
{$ELSE}
{$R-}
result:= ( Byte(AColor shr 16) or
(DWORD(Byte(AColor shr 8)) shl GreenShift) or
(DWORD(Byte(AColor)) shl RedShift) or
(DWORD(Transparency) shl AlphaShift));
{R+}
{$ENDIF}
end;

Re: How to use Teegdiplus

Posted: Thu Oct 21, 2010 10:59 am
by narcis
Dear Werner,

Can you please attach a simple example project or code snippet we can run "as-is" to reproduce the problem here?

Thanks in advance.

Re: How to use Teegdiplus

Posted: Mon Oct 25, 2010 7:23 am
by 10546313
Dear Narcis,

I have uploaded the zip file TestGDIPlus.
Please press the load button and load Dadmix.01z, the chart will be loaded. Zoom rectangle will be shown in case of zoom.
After pressing the gdi+ button the chart change the color to red only and the zoom rectangle will be not shown anymore.

with best regards
Werner

Re: How to use Teegdiplus

Posted: Mon Oct 25, 2010 11:01 am
by narcis
Hi Werner,

Thanks for the example code. I think I could narrow down the issue to this code:

Code: Select all

uses TeeGDIPlus, TeeSurfa;

procedure TForm1.FormCreate(Sender: TObject);
var g :TGDIPlusCanvas;
begin
  g:=TGDIPlusCanvas.Create;

  Chart1.Canvas:=g;
  Chart1.AddSeries(TSurfaceSeries.Create(Self)).FillSampleValues;
  (Chart1[0] as TSurfaceSeries).FastBrush:=True;
end;
Setting FastBrush to False works fine. I've checked this also works fine in your example. Anyway, I have added the defect (TV52015236) to the bug list to be fixed for future releases.

The zoom pen issue already works fine using TeeChart Pro 2010 VCL. GDI+ canvas has been improved substantially in 2010 version.