XForms: flimage expose is slow

From: Luis Balona (lab@maia.saao.ac.za)
Date: Sat Feb 17 2001 - 08:44:58 EST

  • Next message: Steve Lamont: "Re: XForms: flimage expose is slow"

    # To subscribers of the xforms list from Luis Balona <lab@maia.saao.ac.za> :

    I have been using xforms for three years and can only thank you most
    sincerely for the wonderful tool that you have provided for the community.
    I have a problem which has been bugging me for a long time. Maybe you have
    an answer.

    I have created a canvas as follows ...

        canvas = fl_add_canvas(FL_NORMAL_CANVAS, 10, 10, IM_W, IM_H," ") ;
        fl_set_object_color(canvas, FL_COL1, FL_COL1);
        fl_add_canvas_handler(canvas, Expose, expose_handle, 0);
        fl_set_object_boxtype(canvas,FL_FLAT_BOX) ;

    on which I place an image:

        flimage_display(image, FL_ObjWin(canvas)) ;

    This is "expose_handle":
         
    static int expose_handle(FL_OBJECT *obj, Window win,
                             int w, int h, XEvent *xev, void *junk)
    {

      flimage_display(image, FL_ObjWin(canvas));
      return 0;
    }

    Everything works fine, except that the image takes quite long (i.e a second
    or so) to be redrawn whenever an expose event occurs. This is annoying. As
    an experiment, I placed the image in a box rather than a canvas:

        box = fl_add_box(FL_UP_BOX,0,0,WIDTH,HEIGHT,"");
        flimage_display(image, FL_ObjWin(box)) ;

    The refresh here is instantaneous, just as I would like, but of course I
    lose the power of having the image on a canvas. Can you suggest a way of
    making the refresh quicker on a canvas?

    Best regards
    Luis Balona
    South African Astronomical Observatory
    lab@saao.ac.za

    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Sat Feb 17 2001 - 04:25:49 EST