Changeset 26487 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-08-08T09:59:19+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerAbstract.java
r25219 r26487 64 64 private static int m_counter = 0; 65 65 // This is the main image to be displayed 66 private BufferedImage m_image = null;66 private Image m_image = null; 67 67 // Initial position of the image in the real world 68 68 private EastNorth m_initial_position; … … 132 132 133 133 // Create image 134 Imageimage = createImage();135 if ( image == null ) {134 m_image = createImage(); 135 if ( m_image == null ) { 136 136 throw new IOException(tr("PicLayer failed to load or import the image.")); 137 137 } 138 // Convert to Buffered Image - not sure if this is the right way... 139 m_image = new BufferedImage( image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB ); 140 Graphics g = m_image.getGraphics(); 141 g.drawImage( image, 0, 0, null ); 138 // Load image completely 139 (new ImageIcon(m_image)).getImage(); 142 140 } 143 141 … … 224 222 225 223 // Draw picture 226 g.drawImage( m_image, -m_image.getWidth( ) / 2, -m_image.getHeight() / 2, null );224 g.drawImage( m_image, -m_image.getWidth(null) / 2, -m_image.getHeight(null) / 2, null ); 227 225 228 226 // Draw additional rectangle for the active pic layer … … 230 228 g.setColor( new Color( 0xFF0000 ) ); 231 229 g.drawRect( 232 -m_image.getWidth( ) / 2,233 -m_image.getHeight( ) / 2,234 m_image.getWidth( ),235 m_image.getHeight( )230 -m_image.getWidth(null) / 2, 231 -m_image.getHeight(null) / 2, 232 m_image.getWidth(null), 233 m_image.getHeight(null) 236 234 ); 237 235 } … … 320 318 // initial scale is in m/100pix 321 319 // So for now, we support the bounding box only when everything is in meters 322 if ( projcode.equals("EPSG:3857") ||projcode.equals("EPSG:4326") )320 if (projcode.equals("EPSG:4326") ) 323 321 return; 324 322 -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java
r25219 r26487 62 62 super(info); 63 63 64 System.err.println("hi there!"); 64 65 // Create menu entry 65 66 if ( Main.main.menu != null ) {
Note:
See TracChangeset
for help on using the changeset viewer.