Re: gtkdrawing x gtkpixmap



On Qua, 2003-03-12 at 01:33, Brandon wrote:
"Gustavo J. A. M. Carneiro" wrote:

On Ter, 2003-03-11 at 18:23, Samir Bonho wrote:
Hi folks ,

I read almost everything about GTKDrawing and GTKPixmap. I compiled an
example (scribble-simple) to understand this functions.For my life in
earth  be peacefull I need to know :

What is the biggest difference of a Drawing area and a Pixmap ???

  GtkDrawingArea is a widget.  A GdkPixmap is an X server object that
contains a grid of colored pixels.  A widget contains a 'window' member,
which is a 'drawable' (GdkDrawable).  A pixmap is also another type of
drawable, like a window, but offscreen.  I'm not sure how clear this


so why would I declare a jpg, that i want to display, as a pixmap if by
defintion a pixmap is offscreen?

  Declare a jpg as pixmap?... I find this sentence a bit confusing..
perhaps you mean 'load a jpg into a pixmap'?..

  Anyway, a pixmap is a bunch of pixel values, kept in a memory buffer
in the X server.  It is not on-screen.  It is not visible.

  Windows, on the other hand, are directly visible on the screen, but
they do not keep its contents. For example, when a window is put on top
of another, the one that is behind loses its contents (it has no
presistent memory).  A pixmap may not be visible on screen, but at least
it never loses its contents.

  So, to make anything useful, the usual trick is combine them both. You
have a widget with a window mapped on screen.  You also have a
(offscreen) pixmap, with the same width/height as the window, that you
paint with whatever you wish to display on screen.  Then, with an expose
event handler, you paint the bits that need to be drawn from the pixmap
into the window.

  Regards.

-- 
Gustavo João Alves Marques Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>





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