<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Bitstream Vera Sans">Hi<br>
I'm trying to use gtk printing in my app. It uses cairo to draw.<br>
I'd like to fill paths with different hatches. I'm using the code below
to create a little part of the hatch and to repeat it to fill the path.<br>
The problem is that when I do it, there's a little space (a thin and
transparent line) between each repeat. For example, if I want to repeat
a completely black square (see the code below), it gives me this result
: <a class="moz-txt-link-freetext" href="http://img96.imageshack.us/img96/8747/cairopblmcw6.png">http://img96.imageshack.us/img96/8747/cairopblmcw6.png</a><br>
I expected it to draw a completely black area. If I draw a line or
anything else instead of a black square, I get the same type of result.<br>
This result is displayed in the preview window of gtk printing (in fact
in evince).<br>
Is there any way to suppress this line ?<br>
Thanks.<br>
<br>
The code :<br>
<br>
cairo_t * cr;<br>
cairo_surface_t *surface;<br>
surface =
cairo_surface_create_similar(cairo_get_target(m_cairo),CAIRO_CONTENT_COLOR_ALPHA,5,5);<br>
cr = cairo_create(surface);<br>
cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);<br>
cairo_set_line_width(cr, 1);<br>
cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);<br>
cairo_set_source_rgba(cr, redPS, greenPS, bluePS, alphaPS); //these
values give black color<br>
cairo_paint(cr);<br>
cairo_stroke (cr);<br>
cairo_destroy(cr);<br>
cairo_pattern_t * pattern = cairo_pattern_create_for_surface (surface);<br>
cairo_surface_destroy(surface);<br>
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);<br>
cairo_set_source(m_cairo, pattern);<br>
//here i create a path in another cairo context (m_cairo)<br>
//and i fill it with the pattern:<br>
cairo_fill( m_cairo );<br>
<br>
</font>
</body>
</html>