Re: [gtkmm] Need help with Gtk::DrawingArea



Gene Ruebsamen <gene erachampion com> writes:

[...]

> (2) What is the difference between a Pixmap and a Pixbuf? In what
> cases should we prefer one over the other? Also, it seems like the
> pixbuf class has more member functions for copying portions of the
> pixbuf to a Gtk::DrawingArea, while the pixmap lacks many of these
> functions. Is there a reason why?

Remember that X has a server-client model where the server is the part
closest to your graphics card, whereas the client (your program) can
be located on another computer, transmitting data over the network.
Pixmaps are server-side resource, e.g. they could be allocated in your
video card memory (I think). So they can be displayed very fast.

Pixbufs are client-side resources which means they are much more
flexible. You are not limited to what the X guys thought about some 15
years ago or so. :-) But pixbufs can't be optimized by the video
hardware, and you have to transfer the pixels to the server at some
point.

> I'm hoping that once I fully understand Drawing in Gtkmm2.2, I can
> help update the documentation.

In general, the GnomeCanvas is usually much easier to use than a
drawing area. It manages all these nitty-gritty details itself.

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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