[cairo] how to copy a rect area from one surface to another

abhidhnya sonawane abhidhnya.sonawane at gmail.com
Tue Dec 16 22:56:40 PST 2008


Hi,

No.
You can specify the starting point of the source,
Try out the code given there.
The main difference is to use cairo_fill instead of cairo_paint.

If you'd like to instead copy some (width, height) rectangle from (source_x,
source_y) to some point (dest_x, dest_y) on the destination you would
instead compute a new position for the source surface origin and then use
cairo_fill instead of cairo_paint:

cairo_set_source_surface (cr, dest_x - source_x, dest_y - source_y)
cairo_rectangle (cr, dest_x, dest_y, width, height);
cairo_fill (cr);

Here:
source_x =starting x-co-ordinate of the source surface.
source_y =starting y co-ordinate of the source surface.

regards,
Abhidhnya.
On Wed, Dec 17, 2008 at 12:19 PM, abhidhnya sonawane <
abhidhnya.sonawane at gmail.com> wrote:

> Hi,
>
> They have given in it how to copy from source_x ,source_y to dest_x,dest_y.
> read again.
>
> Its given starting as :
>
> If you'd like to instead copy some (width, height) rectangle from (
> source_x, source_y) to some point (dest_x, dest_y) on the destination you
> would instead compute a new position for the source surface origin and then
> use cairo_fill instead of cairo_paint:
>
>
> regards,
> Abhidhnya .
>
>
> On Wed, Dec 17, 2008 at 12:14 PM, abhidhnya sonawane <
> abhidhnya.sonawane at gmail.com> wrote:
>
>> Hi,
>>
>> I have done some thing like this previously.
>>
>> Please see the link below, you will get the way to do it .
>>
>> http://www.cairographics.org/FAQ/
>>
>> Question 2a.
>>
>> regards,
>> Abhidhnya.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20081217/db4a8e64/attachment.htm 


More information about the cairo mailing list