[cairo] newbie question - fill pre-existing png polygons?
alex.shulgin at gmail.com
Sun Aug 15 02:15:37 PDT 2010
On Mon, Aug 9, 2010 at 20:30, Daniel Goldman <dagoldman at yahoo.com> wrote:
> I use GD to make maps with labels and color fills. To add pdf output, I've
> using cairo / pango. The pdf is looking great so far.
> To make it easier to keep label placement consistent between png and pdf,
> I'm working on switching the png maps to also use cairo.
> With GD, I would import a png outline of the map that has been generated before,
> and use gdImageFill () to fill a polygon. With cairo, it's easy to get the
> outline map
> in with cairo_image_surface_create_from_png (). But I'm getting the feeling that
> is not a helpful step under cairo, that cairo does not fill existing png
Are you asking for a 'Flood Fill' tool in cairo? If so, I think
there's none and it's not going to happen.
May be you can turn to use cairoscript backend to record your polygons
into a file. Then load them and fill the path using cairo_fill().
More information about the cairo