I'm trying to place an image from an URL.
I came up with something like this:
importPackage(java.net); importPackage(java.awt); var url = "http://www.mydomain.com/my_image.jpg"; var image = Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(url); var my_image = new PlacedItem(image); my_image.moveTo(100,100);
When I print out the image variable it gives me a java-reference wich gives me the impression the image has been loaded:
sun.awt.image.ToolkitImage@186f3b3
But as it seems PlacedItem() doesn't work like I thought it would.. the above script gives me the following error:
ReferenceError: "PlacedItem" is not defined. at scriptsgetImageFromURL.js:7
can anyone tell me how to place the image in the document?
I'm running Sg 2.0.0.20 From wich I removed the java.vm file to make it run on my Win XP / CS2 (as proposed somewhere on these forums)
- --------
edit:
I found the place() and paste() commands, but do I need to construct the image first from the java-reference before being able to place/paste it?