[Lazarus] Get JPEG from TAChart in CGI app

Michael Van Canneyt michael at freepascal.org
Sun Mar 20 19:30:27 CET 2011



On Sun, 20 Mar 2011, Leonardo M. Ramé wrote:

> On 2011-03-21 03:58:12 +1000, Alexander Klenin wrote:
>> On Mon, Mar 21, 2011 at 03:22, Leonardo M. Ramé <l.rame at griensu.com> wrote:
>>
>>>    lCanvas.CopyRect(0,0,TFPCustomCanvas(lChart.Canvas),lRect);
>>
>>> After executing the method I'm getting "Control '' has no parent
>>> window' at the CopyRect line. I'm sure there is another method to copy a
>>> TCanvas to a TFPCustomCanvas.
>>
>> Use Chart.PaintOnCanvas instead. See savedemo for an example.
>> Note that you must give it full TCanvas -- just TFPCanvas is not enough.
>>
>
> 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.

Simply said: you can't.

The current TAChart is not suitable for a CGI application. It expects a GUI.

Michael.


More information about the Lazarus mailing list