<br><font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif">I am trying to scale an image by 50
%.</font>
<br>
<br><font size=2 face="sans-serif">I tried with the following code but
it does not work:</font>
<br>
<br>
<br><font size=2 face="sans-serif"> cairo_save(cr);</font>
<br>
<br><font size=2 face="sans-serif"> cairo_set_source_surface(cr,
local_surf, target_x, target_y);</font>
<br>
<br><font size=2 face="sans-serif"> //
these 2 lines are used for scaling</font>
<br><font size=2 face="sans-serif"> cairo_pattern_set_matrix
(cairo_get_source(board->cr), &matrix);</font>
<br><font size=2 face="sans-serif"> cairo_pattern_set_filter(cairo_get_source(board->cr),
CAIRO_FILTER_BEST);</font>
<br>
<br><font size=2 face="sans-serif"> cairo_paint(cr);</font>
<br><font size=2 face="sans-serif"> cairo_restore(cr);</font>
<br>
<br><font size=2 face="sans-serif">Another attempt is like this:</font>
<br>
<br><font size=2 face="sans-serif"> cairo_matrix_t
matrix;</font>
<br><font size=2 face="sans-serif"> cairo_matrix_init_scale
(&matrix, 0.5, 0.5);</font>
<br><font size=2 face="sans-serif"> cairo_pattern_t*
pattern = cairo_pattern_create_for_surface(my_surface);</font>
<br><font size=2 face="sans-serif"> cairo_pattern_set_matrix
(pattern, &matrix);</font>
<br><font size=2 face="sans-serif"> cairo_pattern_set_filter(pattern,
CAIRO_FILTER_BEST);</font>
<br>
<br><font size=2 face="sans-serif"> cairo_set_source(cr
, pattern);</font>
<br><font size=2 face="sans-serif"> cairo_rectangle(cr,
x, y, w, h);</font>
<br><font size=2 face="sans-serif"> cairo_fill(cr);</font>
<br>
<br><font size=2 face="sans-serif">But it also does not work.</font>
<br>
<br><font size=2 face="sans-serif">What is the correct way to do this ?
Thanks.</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br><font size=2 face="sans-serif">Kelvin</font>