On Mar 27, 2004, at 4:26 PM, Karl Koch wrote:
> Hello Jess, hello OpenMap group,
>
> I found the posting of Jess with the code of how to solve the
> rasterlayer
> problem:
>
> http://openmap.bbn.com/mailArchives/openmap-users/2001-07/0147.html
>
> Since I do not use the latest OpenMap version I now foudn something
> which I
> could intregrate into my application.
>
> However I also do not have access to the BufferedImageHelper class, I
> tried
> to write around using java.awt.Image directly.
>
> I have some problems, but first of all I would like to ask some
> questions
> about the GeoRefImageLayer class from Jess:
>
> The following 3 lines are from the projectionChanged method:
>
> 1) BufferedImage bi =
> BufferedImageHelper.getBufferedImage(mImageFileName,
> 0, 0, -1, -1);
> 2) int height = bi.getHeight();
> 3) int width = bi.getWidth();
>
> What is the first line doing exactly? Does it mean that the image is
> loaded
> with x=0 y=0 and negative height and width?
It's creating a BufferedImage from the image file, starting at 0, 0
(upper left corner) and maintaining the size of the image as it is in
the file. The -1, -1 is a flag to just use the size of the image.
> How can I do the same with java.awt.Image ?
That was a really hard problem that BufferedImage solved. Does Swing
1.1 have ImageIcon? That's another good way to do it. You might have
to look at the ImageProducer and ImageConsumer interfaces. Look at the
older version of OMRasterObject, it used to build images out of pixels
before BufferedImage.
- Don
-- [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 Mon Mar 29 18:32:46 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT