[cairo] Linen Texture
LRN
lrn1986 at gmail.com
Tue Jul 30 06:07:54 PDT 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 30.07.2013 16:00, Bobby Salazar wrote:
> On 7/29/13, Simon Sapin <simon.sapin at exyr.org> wrote:
>> Le 29/07/2013 13:35, Bobby Salazar a écrit :
>>> Does anyone know if it is possible to produce a linen texture using
>>> Cairo? Ideally I would like to create a Cairo pattern than can be used
>>> to fill a path. Ideally, I would like something similar to this:
>>>
>>> http://tutvid.com/create-linen-texture-photoshop/
>>>
>>> Does anyone have any ideas how to accomplish this?
>>
>> If you’re doing something pixel-based:
>>
>> 1. Do as in that link you gave
>> 2. Save the result as PNG
>> 3. Use cairo_image_surface_create_from_png() to get a cairo surface
>> 4. Make a surface pattern from that
>> 5. Set the pattern’s "extend" to CAIRO_EXTEND_REPEAT
>> 6. Use the pattern as a source.
>>
>> http://cairographics.org/manual/cairo-PNG-Support.html
>> http://cairographics.org/manual/cairo-cairo-pattern-t.html
>> http://cairographics.org/manual/cairo-cairo-t.html
>>
>>
>> If you want vectors it’s gonna be more tricky: you’ll need to express
>> the effect you want in terms of paths, colors, gradients, etc.
>
> I was hoping that somebody knew a good way to produce the linen
> texture using Cairo calls instead of me having to import raw pixel
> data from an outside source.
>
> Does anyone know of a way to reproduce this kind of look at run-time?
>
Try drawing it by hand in Inkscape.
If you succeed (and the image scales well), then it can be done in
cairo. Otherwise it can't be done in cairo.
- --
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
iQEcBAEBAgAGBQJR97qpAAoJEOs4Jb6SI2Cwfg8IAMyLVJW9E1qv8XU7uzlpSQbx
xi3aFAVwS0rSd3PieMHt+RYqcjYmB92Mr7LEtnIsdhCNqznMvhYwq9TdepZUfPu0
ism3/6GC5H3wPI3g5Zyb/7AKKplr0oNIxBenX9+nz5sp5SzK2ZiVz0JrmCiUGYZt
o5ebEMNwNCLTl9zkjG/686P2+YiHOHfM2psEkNbrZifZNQKT+itcTJfTFkiE4aMu
d664cFNiM9fucL0hK2MlbZARV/Zu6B0IfZWPtzTINKVFZURyJ+rDwKJwhLGeGMld
+bG/AVIhxoNfP6RRr83iKJYey1Fb0ZcqPGD3IVAkMyZAbjxgTfFHtRto/fJaL3s=
=vTXT
-----END PGP SIGNATURE-----
More information about the cairo
mailing list