bH wrote:
..
public class IconMapShoScale extends JPanel{
This example might have been an SSCCE except for:
a) line wrap, which had to be fixed before it compiled
b) lack of images locally.
For the first, you might try <http://www.physci.org/twc.jnlp>
This little tool shows the width of the source/text pasted
in the text area. I recommned limiting it to '62 chars' for
usenet posts.
For the second, try obtaining images that are small (in bytes),
but large enough (in width/height) to show the problem,
directly off the net. If you have a site of your own, upload
some examples to use, otherwise the code might get them
off another site.
Here is one image search..
<http://images.google.com.au/images?q=+filetype:jpg&as_st=y&svnum=10&h...
That search locates images that are 'small' in width/height.
As to the technical side of the problem, I suspect it is
non-optimal to create an ImageIcon. I would tend to use
a JPanel, override paintComponent and draw the Image
directly (Graphics.drawImage()). Once the points are
obtained, it is a simple matter to Graphics.drawLine()
(obviously, draw the lines *after* the image itself is drawn).
--
Andrew Thompsonhttp://www.athompson.info/andrew/
Message posted viahttp://www.javakb.com
Thanks for the text width checker.
This is supplied below.
/* Notes for use....
* Map scale enter number to be used; i.e. 600