Can GMF load eps images ? [message #179068] |
Wed, 26 March 2008 06:06  |
Eclipse User |
|
|
|
Hi Team,
Is there any way in which I can load an eps image in my editor?
Currently my ImageDescriptor extends ScalableImageFigure for my node,
which successfully loads .gif, .bmp, .jpeg files. But I am not able to
load an .eps file.
~Sandip
|
|
|
|
|
|
Re: Can GMF load eps images ? [message #179484 is a reply to message #179348] |
Fri, 28 March 2008 02:30   |
Eclipse User |
|
|
|
Hi Tony,
I think I tool the ideas from the following two tutorials... please have a
look into them. Incase you cant solve it let me know.
http://wiki.eclipse.org/index.php/GMF_Tutorial_BPMN
http://wiki.eclipse.org/index.php/GMF_Tutorial_Part_3
Remember your ImageDescriptor should extend ScalableImageFigure for this
job.
Use the following constructor -
public ContainerImageDescriptor(RenderedImage lastRenderedImage,
boolean myUseLocalCoordinates, boolean myOriginalColor,
boolean myAntiAlias) {
super(lastRenderedImage, myUseLocalCoordinates, myOriginalColor,
myAntiAlias);
createContents();
}
Next in your createNodeShape(), ensure you create new descriptor passing
the URL of the image file.
figure = new
ContainerImageDescriptor( RenderedImageFactory.getInstance(url), true,
true, true);
Hope this helps.
|
|
|
|
Re: Can GMF load eps images ? [message #180287 is a reply to message #179476] |
Wed, 02 April 2008 02:43  |
Eclipse User |
|
|
|
Guys, this tool needs a eps/ps interpreter and it uses GhostScript for it.
This tool works fine, if you have installed Ghostscript.
I am using it internally to convert my eps images into .png files (Runtime
shell execution), and later reading it using our RenderedImage objects.
There is also a java library avialable which wraps this tool. Its called
Jmagick.
Someone can evaluate that too.
|
|
|
Powered by
FUDForum. Page generated in 0.05165 seconds