[Lazarus] Get JPEG from TAChart in CGI app

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Mar 20 23:41:37 CET 2011


On Mon, 21 Mar 2011 04:58:18 +1000
Alexander Klenin <klenin at gmail.com> wrote:

> On Mon, Mar 21, 2011 at 04:46, Michael Van Canneyt
> <michael at freepascal.org> wrote:
> >> 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.
> 
> Hm. For me GUI means "graphical user interface" -- that is, windows (aka forms),
> interacting with mouse, etc.
> I have just committed a demo which does not have any of this,
> and yet successfully draws TChart to a file -- see previous mail.
> Maybe for you GUI means a different thing?

Yes. The GUI of the screen.
By accessing the LCL canvas you access the widgetset (gtk2) which
accesses the current screen. For example the gtk2 asks for
theme, fonts, screen color depths and sub pixel rendering parameters.
A cgi program has no screen.
The LCL canvas is an implementation of the abstract TFPCustomCanvas,
and uses a widgetset to render. The nogui widgetset does not implement
rendering, so you can not draw with it.
There are other implementations of TFPCustomCanvas without the need
of a screen. The fcl provides one. Probably TAggFPCanvas can work
without screen too. The last time I checked the main problem is the
font support. It is far less comfortable as the LCL.
It is a good idea to add a render function to TAChart for
TFPCustomCanvas.


Mattias





More information about the Lazarus mailing list