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

Re: Set Origin for Draw Operations?



On Sat, Jun 05, 1999 at 06:10:42PM -0400, Havoc Pennington wrote:
> 
> On Sat, 5 Jun 1999, SEGV wrote:
> > 
> > I want to set the origin of a drawingarea widget so that when I draw, my
> 
> I don't think there's a way to do this; the best approximation I can think
> of would be to draw to a pixmap buffer, then copy the pixmap to 32,32. 
> 
> I would suggest writing your own little interface to do this with;...

My own 2c of thought.  I would prefer having everything in a pixmap of
just the right size, and move the pixmap around within the drawing area.
This way, the code that draws on the pixmap is simpler, and the code
that draws the actual pixmap on the drawing area is only increased by a
couple of lines of code or so.

By looking at how this is implemented in `another' GUI toolkit for X11
(yep, I also have Qt installed on my system, even though I only use GTK+
for developing *my* apps), I saw in the sample programs this technique
being used to draw the moving ball shot by a cannon.  Draw on the
pixmap once, then use it many times on the drawing area :)

Seems to work reasonably fast...

-- 
     ?     | Giorgos E. Keramidas, <mailto:keramida@ceid.upatras.gr>
  >(o.o)<  | http://students.ceid.upatras.gr/~keramida/index.html
     O     | "Oggi non e` un giorno doppo ieri, ma un giorno prima di domani."



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