Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsGEF png fails when WebSphere run as a Windows Service
https://www.eclipse.org/forums/index.php/mv/msg/154037/485070/#msg_485070
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]]>2009-09-10T13:11:06-00:00Re: GEF png fails when WebSphere run as a Windows Service
https://www.eclipse.org/forums/index.php/mv/msg/154037/487670/#msg_487670
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?