<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div></div>
<a href="https://stackoverflow.com/posts/59928580/timeline" title="Timeline"></a>
<div>
<p>I've gone through the cairo graphics examples using patterns.</p>
<pre><code>pattern = cairo_pattern_create_for_surface (image);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
</code></pre>
<p>Now instead of "image" I have a surface with a sequence of :- </p>
<pre><code>cairo_move_to(cr, xc[0], yc[0]);
for (int i = 0; i < xc.size(); i++)
cairo_line_to(cr, xc[i], yc[i]);
</code></pre>
<p>How do I use this generated cairo surface and use it as input for the pattern ? It does not work if I simply use
<code><br>
</code></p>
<p><code>pattern = cairo_pattern_create_for_surface (surface);</code> where surface has the cairo_t cr that I used for the generated pattern..</p>
</div>
<br>
</div>
</body>
</html>