<br><font size=2 face="Arial">Hi James</font>
<br>
<br><font size=2 face="Arial">I think the following post contains the answer:</font>
<br><font size=2 face="Arial">http://article.gmane.org/gmane.comp.gis.mapserver.user/17904/</font>
<br>
<br><font size=2 face="Arial">The result of the getBytes-method of the
imageObj is </font>
<br><font size=2 face="Arial">javax.imageio.ImageIO.read.</font>
<br>
<br><font size=2 face="Arial">Benedikt</font>
<br>
<br><font size=2><tt>UMN MapServer Users List &lt;MAPSERVER-USERS@LISTS.UMN.EDU&gt;
schrieb am 10.04.2006 13:45:04:<br>
<br>
&gt; Hi,<br>
&gt; <br>
&gt; I am working with java/mapscript and am trying to convert an <br>
&gt; edu.umn.gis.mapscript.imageObj into some kind of java image object
(ideally <br>
&gt; something that implements java.awt.image.RenderedImage &#8211; but anything
would <br>
&gt; be a start). &nbsp;This is so I can manipulate the image, using JAI
and java2d, <br>
&gt; and then stream the modified image as a SOAP message response.<br>
&gt; <br>
&gt; At the moment I am saving the image to a temporary file (java code
shown <br>
&gt; below), using the imageObj.save() method, and then reloading that
image into <br>
&gt; my java object. &nbsp;This is not a desirable solution for obvious
performance <br>
&gt; and scalability reasons &#8211; especially as I seem to need to pause after
the <br>
&gt; save to avoid the load command giving intermittent errors.<br>
&gt; <br>
&gt; Does anybody have any experience of converting the imageObj into a
more <br>
&gt; useful java object? &nbsp;Has anyone written a java or c method to
aid this, or <br>
&gt; found another way round a similar problem?<br>
&gt; <br>
&gt; Regards,<br>
&gt; James<br>
&gt; <br>
&gt; ---Java code snippet---<br>
&gt; <br>
&gt; imageObj image = mapobj.draw(); &nbsp;//define imageObj<br>
&gt; <br>
&gt; String filename = &quot;/var/www/html/gis/scratch/maptemp.png&quot;;<br>
&gt; File filefilename = new File(filename); &nbsp;// set temp file variables<br>
&gt; <br>
&gt; image.save(filename, mapobj); &nbsp;// save image to disk<br>
&gt; <br>
&gt; Thread.sleep(1000); // pause to ensure has saved - avoids errors<br>
&gt; <br>
&gt; BufferedImage bufimg = ImageIO.read(filefilename); &nbsp;// load it
again<br>
</tt></font>