Moving a pixmap "sideways"



Hello,

This must be a common question...

I am trying to do a diagram application. Basicaly a
plotter of y values over time.

        +-------------------------+
new     |. ..                     |
values  | .  .  . ...     ...     |
from    |     .      .....        |
left    |                         |
        +-------------------------+
          -> diagram moving this way

I have made a mixmap and draw on this and
every secund I send an expose event and
make a

 gdk_draw_pixmap( widget->window,
                   widget->style->fg_gc[GTK_WIDGET_STATE ( widget ) ],
                   pixmap,
                   event->area.x, event->area.y,
                   event->area.x, event->area.y,
                   event->area.width, event->area.height);

Before that i have to repaint the pixmap with new values

for( pixmap with )
{
  for ( pixmap hight )
    {
       translate all pixels;
    }
}

This works nice and is flickerfree BUT!!! The performance is
lousy! Is there a way just to move the pixmap (copy it in
the X-server) and just redraw the begining every time?

Any exampel code anyone?

Goran Hasse

----------------------------------------------------------------
Göran Hasse            email: gh raditex se     Tel: 08-6949270
Raditex AB             http://www.raditex.se
Sickla Alle 7, 1tr                              Mob: 070-5530148
131 34  NACKA, SWEDEN





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