gdi+ with webbroker?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Charlie
Newbie
Newbie
Posts: 1
Joined: Thu Feb 02, 2012 12:00 am

gdi+ with webbroker?

Post by Charlie » Tue Apr 24, 2012 10:50 pm

Hi,

We use tchart to create graphs, save them to jpegs or pings, and stream them down to a web browser. It works well. However, we would like to use the new tTeegdiplus component to anti-alias and streamline the charts.

We have tried creating a teegdiplus at runtime and assigning its teechart property, e.g.,
gdiCanvas := tTeeGDIPlus.create(nil);
gdiCanvas.TeePanel := mynewchart;

However when we set the gdicanvas.active property to true we get a "no parent window control message".

We also tried creating a form at runtime, then assigning the teechart and the TeeGDIPlus component to it (e.g., gdiCanvas := tTeeGDIPlus.create(mynewform)) but still get the same error message.

Any help would be appreciated.

Thanks.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: gdi+ with webbroker?

Post by Yeray » Fri Apr 27, 2012 8:16 am

Hi Charlie,

I haven't tried it with WebBroker, but creating a simple chart with GDIPlus and exporting it to jpg/png seems to work fine for me here.

Code: Select all

uses Chart, TeeGDIPlus, Series, TeeJPEG, TeePNG;

procedure TForm1.FormCreate(Sender: TObject);
var mynewchart: TChart;
    gdiCanvas: tTeeGDIPlus;
begin
  mynewchart:=TChart.Create(nil);
  mynewchart.Parent:=Self;

  gdiCanvas := tTeeGDIPlus.create(nil);
  gdiCanvas.TeePanel:=mynewchart;
  gdiCanvas.Active:=true;

  mynewchart.AddSeries(TBarSeries).FillSampleValues;

  TeeSaveToJPEG(mynewchart, 'C:\tmp\mynewchart.jpg', mynewchart.Width, mynewchart.Height);
  TeeSaveToPNG(mynewchart, 'C:\tmp\mynewchart.png');
end;
mynewchart.png
mynewchart.png (11.62 KiB) Viewed 2608 times
mynewchart.jpg
mynewchart.jpg (52.9 KiB) Viewed 2616 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply