<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span class="tab"> </span>I want to set the surface to itself and scaled the surface. That is , I want to use just one surface( it has drawed path) to scaled. <br></div><div><span class="tab"> </span><span id="result_box" class="short_text" lang="en"><span class="">I hope you can</span> <span class="hps">understand what I mean. This is the simple code. But the result (</span></span><span id="result_box" class="short_text" lang="en"><span class="">attachment</span></span><span id="result_box" class="short_text" lang="en"><span class="hps">) is very </span></span><span id="result_box" class="short_text" lang="en"><span class="">confused to me. wait fot your reply.</span></span></div><div><span class="tab"> Thank you very much.</span></div><div><span
class="tab"><br></span></div><div><span class="tab"> </span>#define edge 600<br><span class="tab"></span></div><div><span class="tab"><br></span></div><div><span class="tab"> uchar * pbit = (uchar *)malloc(32*edge * edge);<br> memset(pbit, 0, 32*edge * edge); </span></div><div><span class="tab"><br></span></div><div><span class="tab"> </span><span class="tab">surface = cairo_image_surface_create_for_data((uchar *)pbit,<br>
CAIRO_FORMAT_ARGB32,<br> edge, edge,<br> cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, edge));<br> cr = cairo_create(surface);</span> </div><div><br></div><div> cairo_set_source_rgba(cr, 1.0, 1.0, 0.0, 1);<br> cairo_rectangle(cr, 150, 150, 300, 300);<br>
cairo_fill_preserve(cr);<br><br> cairo_set_source_rgba(cr, 0.0, 1.0, 1.0, 1);<br> cairo_stroke(cr);<br><br> cairo_move_to(cr, 150, 150);<br> cairo_line_to(cr, 450, 450);<br> cairo_line_to(cr, 450, 150);<br> cairo_line_to(cr, 150, 450);<br> cairo_stroke(cr);</div><div><br></div><div> cairo_save(cr);<br> cairo_scale(cr, 1.0, 1.4);<br> cairo_set_source_surface(cr, surface, 0, 0);<br> cairo_rectangle(cr , 0, 0, edge, edge);<br> cairo_fill(cr);<br> cairo_restore(cr);</div></div></body></html>