IlvRasterBasicImageReader imageReader = new IlvRasterBasicImageReader(); imageReader.addMap(gifFile);
ImageControlModel
class).imageReader.setImageBounds(0,-Math.PI,Math.PI/2,Math.PI,-Math.PI/2);
IlvMapDataSource imageDataSource = IlvRasterDataSourceFactory.buildTiledImageDataSource(manager,imageReader,true,t rue,null); IlvMapDataSourceModel dataSourceModel = IlvMapDataSourceProperty.GetMapDataSourceModel(manager); dataSourceModel.insert(imageDataSource);
dataSourceModel.start();
IlvRasterIcon
instances
to manage the pixel-on-demand feature and the progressive display
of the new geo-referenced image.int iconWidth=imageReader.getRasterProperties(0).getNumColumns(); int iconHeight=imageReader.getRasterProperties(0).getNumLines(); Image image = Toolkit.getDefaultToolkit().createImage(iReader.getTileLoader(0).getScaledImage Producer(subsampling, new IlvRect(0, 0, iconWidth, iconHeight)));
// The image is known to be at 77 degrees 30 seconds east // and 10 degrees north for the upper left corner. // Lower right corner is at 82 degrees 30 seconds east // and 5 degrees north. IlvCoordinate ul = new IlvCoordinate(77.5, 10); IlvCoordinate lr = new IlvCoordinate(82.5, 5); IlvImageReader reader = new IlvImageReader("image.jpg", ul, lr); IlvMapFeature feature = reader.getNextFeature(); IlvFeatureRenderer renderer = reader.getDefaultFeatureRenderer(); // Image is known to be in the geographic coordinate system. IlvCoordinateTransformation tr = new IlvCoordinateTransformation(IlvGeographicCoordinateSystem.WGS84, IlvGeographicCoordinateSystem.WGS84, new IlvMapAffineTransform()); IlvGraphic g = renderer.makeGraphic(feature, tr); manager.addObject(g, false);
IlvImageTileLoader loader = new IlvImageTileLoader(String pattern, String rowFormatString, String colFormatString);
pattern
argument must
contain one ‘%r’ and one ‘%c’ conversion
specifier. The %r conversion specifier is used to convert the row
index of the tile, and the %c conversion specifier is used to convert
the column index of the tile. These conversion parameters are replaced
accordingly with the rowFormatString
and
the colFormatString
parameters. This format
string is used to construct two java.text.DecimalFormat
strings.