Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF png fails when WebSphere run as a Windows Service
GEF png fails when WebSphere run as a Windows Service [message #485070] Thu, 10 September 2009 13:11 Go to next message
Eclipse UserFriend
Originally posted by: makbulut.us.ibm.com

We have an SWT-based converter.war file that we deploy on Websphere (and
Tomcat) to convert GEF-based diagrams to PNG or JPG files for a web client.

All works fine, except when Websphere is running as a Windows service.
When we disable running WAS as a service our image conversions work
without issues. However, if we enable running WAS as a service, two
issues arise:
- The images produced appear to be "grainy" and don't look nearly as nice
as
those produced when NOT running WAS as a service.
- When we attempt to produce "thumbnail" images of our diagrams, the calls
fail.
The reason for the "thumbnail" issue is that the following calls:
Gdip.Image_GetWidth(img)
Gdip.Image_GetHeight(img)
end up returning 0, when they should instead be returning positive values
(as
they DO do when _not_ running WAS as a service).
More specifically, the code in play is the following:
Image shrunken = new Image(full.getDevice(), size.width, size.height);
GC gc = new GC(shrunken);
gc.setAdvanced(true);
if (gc.getAdvanced())
gc.setInterpolation(SWT.HIGH);
gc.drawImage(full,
0, 0, area / size.width, area / size.height,
0, 0, size.width, size.height);
That last call, gc.drawImage, ends up making the above mentioned calls to
Gdip.Image_GetWidth(img) and Gdip.Image_GetHeight(img).
We've noticed that if we use:
gc.setAdvanced(false);
rather than [from above]:
gc.setAdvanced(true);
the "thumbnail" conversion WILL work [when running WAS as a service], but
of
course the thumbnails produced are VERY grainy, so we don't see this as a
solution.

Any ideas?

Thanks
Burak
Re: GEF png fails when WebSphere run as a Windows Service [message #487670 is a reply to message #485070] Thu, 24 September 2009 05:21 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

Seems that the problem is with the device used.
I assume "full" is an SWT Image you're trying to paint, right? How did you generate that image? What was the device for it?
Did you try asking this question on SWT newsgriup?

Cheers,
Alex

Previous Topic:GEF UML auto layout
Next Topic:TextFlow and FlowPage producing ugly-cropped texts
Goto Forum:
  


Current Time: Thu Apr 25 00:53:29 GMT 2024

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

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

Back to the top