Re: GooCanvas : Clipboard copy
- From: Damon Chaplin <damon karuna eclipse co uk>
- To: Dupuit Cyril <cyrildupuit hotmail com>
- Cc: goocanvas-list gnome org
- Subject: Re: GooCanvas : Clipboard copy
- Date: Sun, 30 Nov 2008 22:11:59 +0000
On Sun, 2008-11-30 at 20:04 +0100, Dupuit Cyril wrote:
> Hi,
>
> I am using GooCanvas for an application that uses clipboard copy. I have
> found a code that copy the canvas directly to the clipboard (I am sorry,
> I have lost the original link to the writer of this code...).
>
> This code doesn't show the real canvas content. I think that all colors
> are drawn on a black sheet (the black text coming from the canvas is
> merged with the black backgound on the clipboard).
>
> Let me show you your example.
>
> First (a screenshot of widgets-demo.jpg).
>
> And the modified example.
>
> When I copy the image to the clipboard, I have the following
> (widgets-demo-clipboard.jpg).
>
> The code is the following :
> surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
> (int)right, (int)bottom);
>
> cr = cairo_create(surface);
>
> cairo_rectangle(cr, left, top, (int)right, (int)bottom);
> #if 0
> cairo_set_source_rgb(cr, 255.0, 255.0, 255.0);
> #endif
> cairo_fill(cr);
>
> goo_canvas_render((GooCanvas *)canvas, cr, NULL, 1.0);
That actually works for me, with the cairo_set_source_rgb() line.
Note that white is 1.0, 1.0, 1.0, but that won't affect this:
http://library.gnome.org/devel/cairo/stable/cairo-context.html#cairo-set-source-rgb
Also cairo_rectangle() takes x, y, width & height arguments:
http://library.gnome.org/devel/cairo/stable/cairo-paths.html#cairo-rectangle
Can you try it again?
Damon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]