<div>Hi,</div><div><br></div><div><br></div><div>I have a problem with free hand line drawing using cairo</div><div>Suppose I have a device with screen width and height as 400 x 400. And I have an image with 200 x 200. Now in my device for this image start of x=100 and end of x = 300. Now </div>
<div>I have to draw the line from 100 to 300..I am using the API    <b>surface = cairo_image_surface_create_for _data(unsigned char *buff,CAIRO_FORMAT_ARGB32,width,height,cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32,width))</b></div>

<div>where width is image width = 200</div><div>height is image height = 200.</div><div>Then I am doing </div><div><b>cr = cairo_create(surface);</b></div><div><br></div><div>Now the problem is as the surface starts from top left only so it will go from 0 to 200 but I want to draw form 100 to 300. So</div>

<div>1) what can I do to shift the origin of the surface fom 0 to 100 ? So that it will draw on the same..</div><div> I am using elementary API(like evas,efl). And on mouse move callback I am drawing the line...</div>
<div>2) I have tried giving whole the width and height as my devise that is width = height = 400. But in this case while saving the image some scaling factor occur and line drawn become thin and position is also shifted. This is because we are capturing 400 x 400 to 200 x 200 image.</div>

<div><br></div><div>First time I am using cairo lib thats why not familiar of everything.</div><div>for the image with the width and height same as screen its working fine..as for that surface as well as image both starts from 0.</div>

<div><br></div><div><br></div><div>Please let me know how to solve this problem(how to shift the origin of the surface so that I can draw exactly from where I want to draw)...</div><br>
<div><br></div>-- <br><font style="font-family:times new roman,serif" size="4"><i><span style="color:rgb(0,0,153)">Regards</span><br style="color:rgb(0,0,153)"></i></font><font color="#000099"><br></font>