[fpc-pascal] Implementing AggPas with PtcGraph

Stefan V. Pantazi svpantazi at gmail.com
Fri Jun 23 20:01:05 CEST 2017


When in doubt, have a look at the source code of the graphical 
primitives to determine the semantics of each one. Unlike line primitive 
which draws a path immediately, lineto is meant to be used multiple 
times, as part of a draw path. So, lineto does not really draw, it just 
adds a vertex to a vertex storage object. To draw a path, you need to 
use the drawPath(option):

   agg^.lineWidth(4);
   agg^.lineColor(0, 155, 0, 255);
   agg^.rectangle(10, 10, 50, 50);
   agg^.lineColor(155, 0, 0, 255);
   agg^.line(60, 10, 60, 50);
   agg^.lineto(100,50);           //no line drawn here, just adds to 
vertex storage
   agg^.drawPath(StrokeOnly);   //draw path
   agg^.lineColor(0, 0, 155, 255);
   agg^.moveto(100, 10);
   agg^.lineto(100,50);           //no line drawn here, just adds to 
vertex storage
   agg^.drawPath(StrokeOnly);   //draw path
   agg^.lineColor(155, 0, 155, 255);
   agg^.line(120, 10, 120, 50);


On 06/23/2017 01:27 PM, James Richters wrote:
> I'm trying to switch over a program to use aggpas but I'm not getting any results from moveto or lineto am I missing something?



More information about the fpc-pascal mailing list