[XForms] Using Xform in background without display

Didier Verkindt verkindt at lapp.in2p3.fr
Thu Mar 13 12:07:01 EDT 2008


To subscribers of the xforms list


Hi,

My application uses Xform for GUI and ROOT for making plots.
And in some cases, I do not want to interact with the application, I would
like to run it in background, producing a ROOT
plot that is written as a jpg file (thanks to ROOT's class TImageDump)
 TImageDump *imgdump = new TImageDump(jpgFileName);
 gDDCanvas->Paint();
 TImage *img = imgdump->GetImage();
 img->SetImageQuality(img->kImgFast);
 img->SetImageCompression(60);
 imgdump->Close();
 imgdump->Delete();

which does not need a display, as far as I know. Only fl_initialize
prevented me to do this on a machine with no display.

According to what you wrote, it seems difficult to have a call to
fl_initialize which would not take care of the display's part.
I am not happy but thanks for your investigation. If you have any
idea to overcome the problem, do not hesitate. I am not a pro of Xform
or X servers, so I do not foresee to find the solution by myself.

Best regards,
Didier

-----------------------------------------------------------
Didier VERKINDT, LAPP, Ch. de Bellevue, 74941 Annecy-le-Vieux, FRANCE
tel:33(0)450091671 or 5573  fax:33(0)450279495  web:lapp.in2p3.fr/~verkindt


On Thu, 13 Mar 2008, Jens Thoms Toerring wrote:

> To subscribers of the xforms list
>
> Hi Jean-Marc,
>
> On Thu, Mar 13, 2008 at 12:50:58PM +0100, Jean-Marc Lasgouttes wrote:
> > Jens Thoms Toerring <jt at toerring.de> writes:
> > > Are you actually using anything from XForms when you want the
> > > program to run without any graphics output?
> >
> > I guess the idea is to use flimage. Does this work without a display?
>
> Mmmm. I have to admit that I didn't went through that part of
> XForms more than very superficially yet, so I could be comple-
> tely wrong. But a short look at that part of the code shows
> that quite a number of Xlib functions are used there, so I
> would guess that you can't use that part (which already is
> separated out into its own library, libflimage.so) without
> having a display (or at least some kind of Xserver that fakes
> a display if there's no screen, which using using xvfb might
> amount to).
>
> And, as far as my (very limited) understanding goes, all the
> functions in flimage are meant to read in a graphics file and
> display it on the screen (e.g. on top of a button etc.) or to
> write out an image from an X drawable to a file. In both cases
> you would need a display.
>
> Since Didier wrote that he just wants to write out jpg files
> I guess that he will always need to create some X drawable,
> draw something onto it and then write it out. But that would
> involve an X drawable. But if he just wants to convert e.g.
> a gif image to a jpg I would rather recommend to use some-
> thing more suitable in that case, e.g. ImageMagick.
>
>                               Best regards, Jens
> --
>   \   Jens Thoms Toerring  ________      jt at toerring.de
>    \_______________________________      http://toerring.de
> _______________________________________________
> To unsubscribe, send any message to
> xforms-leave at bob.usuhs.mil or see:
> http://cweblog.usuhs.mil/mailman/listinfo/xforms
> List Archive: http://bob.usuhs.mil/pipermail/xforms and
> http://bob.usuhs.mil/mailserv/list-archives/
> Development: http://savannah.nongnu.org/files/?group=xforms
>
_______________________________________________
To unsubscribe, send any message to
xforms-leave at bob.usuhs.mil or see: 
http://cweblog.usuhs.mil/mailman/listinfo/xforms
List Archive: http://bob.usuhs.mil/pipermail/xforms and
http://bob.usuhs.mil/mailserv/list-archives/
Development: http://savannah.nongnu.org/files/?group=xforms



More information about the Xforms mailing list