How to use Teegdiplus

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Werner
Newbie
Newbie
Posts: 46
Joined: Mon Aug 06, 2007 12:00 am

How to use Teegdiplus

Post by Werner » Wed Oct 20, 2010 10:13 am

Hi,

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

with best regards
Werner

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: How to use Teegdiplus

Post by Narcís » Wed Oct 20, 2010 10:28 am

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.
Best Regards,
Narcís Calvet / 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

Werner
Newbie
Newbie
Posts: 46
Joined: Mon Aug 06, 2007 12:00 am

Re: How to use Teegdiplus

Post by Werner » Wed Oct 20, 2010 12:04 pm

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;

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: How to use Teegdiplus

Post by Narcís » Thu Oct 21, 2010 10:59 am

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.
Best Regards,
Narcís Calvet / 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

Werner
Newbie
Newbie
Posts: 46
Joined: Mon Aug 06, 2007 12:00 am

Re: How to use Teegdiplus

Post by Werner » Mon Oct 25, 2010 7:23 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: How to use Teegdiplus

Post by Narcís » Mon Oct 25, 2010 11:01 am

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.
Best Regards,
Narcís Calvet / 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