Re: How to render/update a small rectangle of GdkImlibImage in aGnomeCanvasImage ?



Federico Mena Quintero wrote:
> 
> >  I need a fast update of small, rectangular region of a GdkImlibImage,
> >  which is displayed via a GnomeCanvasImageItem.
> >
[...]
> 
> Application code should never ever call the
> gnome_canvas_request_redraw() and update() family of functions.  These
> are meant to be used only by canvas item implemenations.
> 
> You should simply tell the image item that the image changed:
> 
>         gnome_canvas_item_set (gitem,
>                                "image", gimg,
>                                NULL);

I see. It´s Ok so far, but I can not be satisfied to redraw a 800x800 or 
even bigger Image every few seconds I got a new Line of data...

It is nessesary to see the aquired data online.

I´m rewriting my STM/AFM (Scanning Tunneling Microscopy/Atomic Force
Microscopy) 
Software from the libxforms-0.88...

My previously solution was a selfbuild xforms object, where I do my own
"rendering"
for (supporting 8/15/16/24bit) and palette mapping using the xlib
directly
(with MIT-SHM support).
My object has some very fast inline functions to set single pixels/lines
and
uses calls like

  if(NoShm)
    XPutImage(disp, win, gc, ximage, xs,ys, x0+xs,y0+ys, w,h);
  else    
    XShmPutImage(disp, win, gc, ximage, xs,ys, x0+xs,y0+ys, w,h, False);
  XFlush(disp); 

to refresh the image... after I changed some data in ximage...

> This will redraw the whole image.  Right now there is no way to tell
> it about a small change, though.  This is really not possible with
> imlib, since its dithering algorithm requires a recalculation of the
> whole image.
> 
> Now that GnomeCanvasImage supports GdkPixbuf, it would make sense to
> have a function to notify it about a local change.  I'll look into it.

If there is a nice and fast way solving my problem, I´ll be very 
happy to forget about xlib hacking....

PS: Who knows how gimp does the drawing/refreshing in a area ?

    Percy Zahl
                                                  .^.
                                                  /V\    www.linux.org
Email: zahl@fkp.uni-hannover.de                  // \\   www.gnome.org
 http://www.fkp.uni-hannover.de                 /(   )\  www.gnu.org
                                                 ^^-^^   metager.de
Institut f"ur Festk"orperphysik, Appelstr. 2, D-30167 Hannover
Tel.Labor: +49 (0)511/762-4825, Fax: -4877



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