Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Trying to render image without a Display
Trying to render image without a Display [message #429487] Sun, 07 March 2004 16:51 Go to next message
Eclipse UserFriend
I am using SWT to generate an image that I want to save to a JPG file.
The generation and the save are working fine. It draws the image I want
onto the screen, extracts the Image from the Display and saves it as a JPG.

I want to run this program in background where there is no display device
available. I tried using the printer but, while I got no errors, my JPG
file was empty.

Is there a way to use Display in this 'off-line' environment?

Thanks
Roger
Re: Trying to render image without a Display [message #429749 is a reply to message #429487] Mon, 08 March 2004 15:13 Go to previous messageGo to next message
Eclipse UserFriend
Not sure what "off-line'" means. Could you draw on an Image instead?

"Roger" <roger@senanque.co.nz> wrote in message
news:c2g5ht$e6f$1@eclipse.org...
> I am using SWT to generate an image that I want to save to a JPG file.
> The generation and the save are working fine. It draws the image I want
> onto the screen, extracts the Image from the Display and saves it as a
JPG.
>
> I want to run this program in background where there is no display device
> available. I tried using the printer but, while I got no errors, my JPG
> file was empty.
>
> Is there a way to use Display in this 'off-line' environment?
>
> Thanks
> Roger
>
Re: Trying to render image without a Display [message #429759 is a reply to message #429749] Mon, 08 March 2004 21:26 Go to previous messageGo to next message
Eclipse UserFriend
Steve Northover wrote:

> Not sure what "off-line'" means. Could you draw on an Image instead?

Thanks for replying.

"off-line" at the moment means running as a service under win2k, although
it might be a *nix daemon eventually.

I tried drawing on an image, but I still need a device. The constructors
for Image all take Device as the first arg. I used the Printer instead of
the Display and got no errors but everything was blank.

Regards
Roger
Re: Trying to render image without a Display [message #429988 is a reply to message #429759] Tue, 09 March 2004 04:54 Go to previous message
Eclipse UserFriend
Roger wrote:

> "off-line" at the moment means running as a service under win2k, although
> it might be a *nix daemon eventually.
>
> I tried drawing on an image, but I still need a device. The constructors
> for Image all take Device as the first arg. I used the Printer instead of
> the Display and got no errors but everything was blank.

On a Unix machine you need access to a X11 display in order to use any
AWT drawing operations, even when drawing on an image. It might be the
same for SWT (I haven't tried that yet). XFree comes with Xvfb, a
virtual framebuffer server, which can be used on a server machine to
create a headless X11 display for AWT.

For Windows services, there's an option "Allow service to interact with
desktop" in the service properties. Did you try that? I suppose you
could create a regular SWT Display if desktop interaction is enabled.

--
Stefan Zeiger http://www.szeiger.de http://www.novocode.com
My SWT controls: http://www.novocode.com/swt
Previous Topic:help
Next Topic:KTable Questions
Goto Forum:
  


Current Time: Tue Nov 04 10:14:59 EST 2025

Powered by FUDForum. Page generated in 0.04961 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top