Re: [OpenMap Users] Problems with OMRasterObject

From: Don Dietrick <dietrick_at_bbn.com>
Date: Thu, 14 Oct 2004 09:57:33 -0400

No, JPEG is supported just fine. If java supports the image format,
OpenMap will display it.

The error you are seeing is a result of the Image object not having a
width (-1), which usually means it wasn't loaded. I'd check the path
you are using to load the image - that is, the path from a Java
standpoint. Use "/" instead of "\".

- Don

On Sep 15, 2004, at 5:47 AM, Jeroen Meijer wrote:

> I’ve also tried with ImageIcon
>
>  
>
> ImageIcon bgImage = new ImageIcon(new URL(serverURL +
> "/images/btn_high.jpg"));
>
>  
>
>  
>
> .. but it still fails.. maybe OMGraphic doesn’t support JPEG? The
> requested file IS available
>
>  
>
>  
>
> -----Oorspronkelijk bericht-----
> Van: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com]
> Namens Jeroen Meijer
> Verzonden: dinsdag 14 september 2004 16:22
> Aan: openmap-users_at_bbn.com
> Onderwerp: [OpenMap Users] Problems with OMRasterObject
>
>  
>
> Hi all, i’m trying to add an image to an OMGraphicList.. The image
> itself is loaded, but when rendering the items in the graphic list I
> get the message;
>
>  
>
> OMRasterObject.render: Attempting to draw a Image that is not ready!
> Image probably wasn't available.
>
>  
>
>  
>
> // test
>
> OMGraphic omg2 = createImage();
>
> omg2generate(proj);
>
> graphics.add(omg2); // OMGraphicList
>
>  
>
> protected OMGraphic createImage(){
>
>       OMRaster bg = null;
>
>       try{
>
>         java.awt.Image bgImage = ImageIO.read(new URL(serverURL +
> "/images/btn_high.jpg"));
>
>         bg = new OMRaster(10.0f,10.0f,bgImage);
>
>       }catch(Exception ex){}
>
>      
>
>      
>
>       return bg;
>
>     }
>
>  
>
> What’s wrong? I’ve searched the mailing archives for an answer, but
> found none. Maybe the location layer can be used, but then I have to
> rewrite all my code which I integrated into a mysql
>
> layer.
>
>  
>
> Regards,
>
>  
>
> Jeroen Meijer
>
>  
>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Oct 14 2004 - 10:00:03 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT