[cairo] Pattern rendering questions

Dirk Schönberger dirk.schoenberger at sz-online.de
Thu Aug 21 07:16:56 PDT 2008


> In the first one (diagonal.png):
> I generate a small surface (w, h), stroke a line to it (0,0), (w,h),
> make the pattern, CAIRO_EXTEND_REPEAT, etc, etc.
> - Note the missing pixels, presumably from where the tiles are
>    assembled after the pattern is clipped to the extent of the
>    surface.
>    -> Can anyone suggest any technique which might fill in these
>       missing pixels?
>
>
> In the second one (cross.png)
> As with the previous pattern, I generate this one by drawing an X
> from (0,0), (w,h), etc, but at 50% alpha.
> - Note the darker pixels, presumably from where the pattern
>    overlaps, and the alphas of the individual strokes is combined.
>    (Or, maybe it's from where the tiles overlap.  I'm not sure...)
>    -> Can anyone suggest a technique that would result in a
>       consistent alpha for the entire pattern?
>
>

Seems your patterns are not yet tileable.
I attach some patterns which achieve the wanted effect, however they are
created manually with an image editor. I am not quite sure about how to
create them with Cairo means.
Possibly some clip and offset magic ;)

Regards
Dirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crosshatch.png
Type: image/png
Size: 224 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080821/437298bc/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diagonal.png
Type: image/png
Size: 198 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080821/437298bc/attachment-0001.png 


More information about the cairo mailing list