[Lazarus] Get JPEG from TAChart in CGI app

Michael Van Canneyt michael at freepascal.org
Sun Mar 20 19:46:47 CET 2011



On Mon, 21 Mar 2011, Alexander Klenin wrote:

> 2011/3/21 Michael Van Canneyt <michael at freepascal.org>:
>>> 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.




More information about the Lazarus mailing list