[fpc-pascal] FPC Graphics options?
James Richters
james at productionautomation.net
Mon May 15 16:45:15 CEST 2017
Thank you for the console example. I really don't have anything too complicated, just basic 1 pixel wide lines, arcs and simple text the most complex shapes are outlines of ellipses. I don't have any surfaces or textures or anything really complicated. I did appreciate how much better 1 pixel wide lines and curves appear with the anti-aliasing and sub-pixel accuracy provides.
-----Original Message-----
From: fpc-pascal [mailto:fpc-pascal-bounces at lists.freepascal.org] On Behalf Of Graeme Geldenhuys
Sent: Monday, May 15, 2017 7:33 AM
To: fpc-pascal at lists.freepascal.org
Subject: Re: [fpc-pascal] FPC Graphics options?
On 2017-05-15 11:51, James Richters wrote:
ication to be a 64bit
> application. I have installed
> 'fpc-3.0.2.i386-win32.cross.x86_64-win64.exe' but I don't see any
> fp.exe to run so I'm a bit lost with it.
Yes, I don't know why the Free Pascal team doesn't make official 64-bit versions of FPC. I always end up having to compile my own full 64-bit FPC - which is very easy by the way.
> AggPas looks awesome, but can I use it with my console application?
Yes, you definitely can. I use AggPas in multiple headless servers too as console or CGI applications.
> I downloaded it and can't even run the sample programs included with
> it.. maybe they are Delphi examples or something?
Correct, unfortunately the demos are all GUI based demos at this time,
but any of the actual drawing code inside those demos will be exactly
the same for a console application.
Probably the easiest way to get your feet wet with AggPas is to use the
agg_2D.pas (for non-GUI apps) unit. It doesn't give you the full power
of AggPas, but presents you with a Agg2D object where you simply need to
make graphic drawing method calls.
For example:
// Star shape
agg^.LineCap(CapRound);
agg^.LineWidth(5);
agg^.LineColor($32 ,$cd ,$32 );
c1.Construct(0, 0 , 255, 200);
c2.Construct(0, 0, 255, 50);
agg^.FillLinearGradient(100, 100, 150, 150, c1, c2);
agg^.Star(100 ,150 ,30 ,70 ,55 ,5 );
Attached is a console app example using the agg_2D.pas unit. It also
uses the FPImage units (included with FPC) to generate a "test.png"
image as output. You could use Memory Images too, depending on your
application needs.
Compile the example with the following command
$ fpc -FUunits -Fu../ -Fi../ Agg2DConsole.dpr
Adjust the -Fu and -Fi paths to match your environment, or simply save
the Agg2DConsole.dpr into the "agg-demos" directory and compile with the
above command.
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-pascal
mailing list