The stride is how many pieces of information make up a row of pixels. eg. ARGB is 4xWidth.<br>Since cairo 1.6 you should use the cairo_format_stride_for_width function to get the correct stride (which may differ with cairo optimizations).<br>
<br>~Gerdus<br><br><div class="gmail_quote">On Mon, Apr 14, 2008 at 4:19 PM, Rajeshwaran Paulchamy <<a href="mailto:Rajeshwaran.Paulchamy@toshiba-tesi.com">Rajeshwaran.Paulchamy@toshiba-tesi.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">i have created a surface using the format <b><span style="font-weight: bold;">CAIRO_FORMAT_A1</span></b></span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> surface = cairo_image_surface_create_for_data</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
(imgarray,</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
<b><span style="font-weight: bold;">CAIRO_FORMAT_A1</span></b>,</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
16,
/*width*/</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
18,
/*height*/</span></font></p>
<p style="margin-left: 1in; text-indent: 0.5in;"><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
<b><span style="font-weight: bold;">2 /*stride*/ </span></b> );</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">then i have rendered the image by using below.</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> cairo_mask_surface
( cr,</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
surface,</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
20,</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">
60);</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">the result i have received as below.</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"><img src="cid:image001.jpg@01C89E68.AE754ED0" alt="*" height="42" width="77">
</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">but the result should be come as below</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"><img src="cid:image002.gif@01C89E68.AE754ED0" height="38" width="39"></span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">please help me, in the api <b><span style="font-weight: bold;">cairo_image_surface_create_for_data ()</span></b> what will be the value<b><span style="font-weight: bold;">, </span></b>i have to give to the <b><span style="font-weight: bold;">STRIDE</span></b> parameter to get the correct
output,<b><span style="font-weight: bold;"> </span></b></span></font></p>
<p><b><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial; font-weight: bold;"> </span></font></b></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">i am not clear about <b><span style="font-weight: bold;">STRIDE</span></b>
parameter. what is the exact definition for this? CAIRO document definition not able to
understand by me.</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">cheers,</span></font></p>
<p><font face="Arial" size="3"><span style="font-size: 12pt; font-family: Arial;">rajeshwaran paulchamy.</span></font></p>
</div>
<pre>The information contained in this e-mail message and in any
attachments/annexure/appendices is confidential to the
recipient and may contain privileged information.
If you are not the intended recipient, please notify the
sender and delete the message along with any
attachments/annexure/appendices. You should not disclose,
copy or otherwise use the information contained in the
message or any annexure. Any views expressed in this e-mail
are those of the individual sender except where the sender
specifically states them to be the views of
Toshiba Embedded Software India Pvt. Ltd. (TESI),Bangalore.
Although this transmission and any attachments are believed to be
free of any virus or other defect that might affect any computer
system into which it is received and opened, it is the responsibility
of the recipient to ensure that it is virus free and no responsibility
is accepted by Toshiba Embedded Software India Pvt. Ltd, for any loss or
damage arising in any way from its use.
</pre></div>
<br>_______________________________________________<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br></blockquote></div><br>