[Lazarus] Get JPEG from TAChart in CGI app

Leonardo M. Ramé l.rame at griensu.com
Sun Mar 20 19:44:25 CET 2011


On 2011-03-21 04:38:46 +1000, 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?

Yes, if I try to PaintOnCanvas of a TBitmap, for example. I get "Canvas
does not allow drawing".

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

I'm afraid Michael is right.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list