Re: Drawing antialiased shapes with alpha transparency



On Wed, 2005-01-05 at 20:21 +0100, Samuel Abels wrote:
> > The buffer can be obtained from a Gdk::Pixbuf if you want.
> 
> Thanks, this is what I will do.

I have just finished porting the canvas, and so far libcairo is doing a
fine job in doing exactly what I wanted.
All components draw themselves efficiently to an RGBA surface.
Now I am not sure how to expose that surface in an efficient manner
though.

Is there a way to obtain a Gdk::Window's buffer? Or rather, what is the
best way to obtain an RGB(A) buffer that I can draw to directly.
Gdk::Pixbuf provides ::get_pixels(), but is there a widget holding a
Gdk::Pixbuf?

I also tried using 

  Gdk::Window::draw_rgb_32_image(gc,
                                 x, y, width, height,
                                 Gdk::RGB_DITHER_NONE,
                                 buffer,
                                 stride);

but this API does not allow to copy only an area (x1, y1, x2, y2) of the
source buffer to the widget's buffer (x3, y3), so I would have to create
another temporary image. If I don't, this is very slow (there is a
flicker).
Also, I am wondering why to copy the data in the first place instead of
being able to draw directly into the window's RGB(A) buffer.

Any ideas?

Thanks,
-Samuel
-- 
 ------------------------------------------------------
|      Samuel Abels       |   http://www.debain.org    |
| spam ad debain dod org  | knipknap ad jabber dod org |
 ------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]