[fpc-pascal] Implementing AggPas with PtcGraph

Stefan V. Pantazi svpantazi at gmail.com
Mon Jun 26 17:28:21 CEST 2017


On 06/26/2017 10:21 AM, James Richters wrote:
> Is there a way to re-scale a drawing with agg_2D?

I think so, scaling is one of the transformations that agg supports 
well. The way I would go about this would be to study how agg manages 
the parsing, storage and display of svg drawings, which are basically 
collections of drawing commands, just like yours. Compile, run and 
analyze the code of svg examples, in particular svg_test demo (the one 
with the lion head).

I found a scale feature in aggpas but it only seems to scale items drawn 
after the command is issued.

Scaling is done through matrix multiplication but you need to have all 
your drawing commands stored in a similar way agg does it for svg, so 
that they can be redrawn. This is a more flexible approach than 
reiterating over hardcoded drawing commands. The cost is the increased 
complexity.

I'm wondering if there is a way to send aggpas all my lines and arcs, 
then give it a scale and offset, display it that way, then a different 
scale and offset, then redisplay it that way,

I think doing this in a way similar to svg routines is one way to go and 
may have its limitations. While significantly more complicated, you also 
get as a byproduct the capability of saving your screen (think 
screenshots, etc.) in standard svg format that can be persisted beyond 
your application lifecycle.



More information about the fpc-pascal mailing list