On Mon, 21 Mar 2011, Alexander Klenin wrote:

2011/3/21 Michael Van Canneyt <[email protected]>:
Yes, but, how can I use a TCanvas in a CGI app?

If I write:

Chart.PaintOnCanvas(TCanvas(lCanvas), Rect(0, 0, 100, 100));

I get an Access Violation.

Of course, since you are converting an object to the type it does not belong to.
You should create a TBitmap or another similar object.
Did you look at the savedemo as I proposed in a previous mail?

Simply said: you can't.
The current TAChart is not suitable for a CGI application. It expects a GUI.

Why do you think so?
TAChart should be prefectly capable of rendering on bitmap-based canvas.

Because both TCanvas and TBitmap suppose a GUI. TFPCustomCanvas does not.

Yes, I know about the 'nogui' widgetset, and no, I don't think that's a proper solution.

Michael.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to