Hi Paul,
Hmmm... perhaps your mapbean object is null for some reason?
In my application, I've enabled the possibility of saving the map image as
either JPEG or GIF formats, using the ACME and Sun classes that come
bundled with the OpenMap package. It works great, and you can display the
image with any image viewing tool, including a web browser. Specifically,
I'm calling com.bbn.openmap.gui.SaveAsImageMenuItem.
good luck
jeff
At 12:46 AM 9/6/2001 +1000, Paul Chisholm wrote:
>Hi,
>
>I am building a web server to deliver information, some of which is
>generated by OpenMap. The user profile is such that it is not feasible to
>run an OpenMap applet on the client browser, so I am using OpenMap to
>generate an image that is then sent to the client.
>
>I store the image in a file with the code
>
> SunJPEGFormatter formatter = new SunJPEGFormatter();
> formatter.setImageQuality(0.8f);
> byte[] bytes = formatter.getImageFromMapBean(map);
> FileOutputStream binFile = new FileOutputStream(<filename>);
> binFile.write(bytes);
> binFile.close();
>
>In this context I am not interested in displaying the map bean in a Swing
>JFrame as is usually done, I just want to generate a JPEG from the map
>bean. However, unless I actually display the map bean in a JFrame I get a
>black image. What I currently do on the server is:
>
> create map
> display map in frame
> generate image file
> dispose of frame
>
>Note that its not enough just to create the JFrame, I have to call
>'frame.setVisible(true)'.
>
>Is there any way to convert a map bean to an image without creating the
>JFrame?
>
>Thanks,
>Paul
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Thu Sep 6 11:10:15 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT