I'm trying to scale the bitmaps I'm using for a location layer, but I'm
not having much luck. With the following snippet in the layer.prepare()
method I get no graphics at all. With it commented out, the bitmaps
are fine (but large).
// scale images
float factor = 1f;
for (int i = 0; i < omGraphicList.size(); i++)
{
Location graphic = (Location) omGraphicList.get(i);
OMRaster raster = (OMRaster) graphic.getLocationMarker();
int h = Math.round(raster.getHeight() * factor);
int w = Math.round(raster.getWidth() * factor);
raster.scaleTo(w, h, OMRasterObject.FAST_SCALING);
}
Where should I put this code? I'm going to try the projection
changed event next ... but I'd like to know why the above doesn't
work--I'll read up on the ImageIcon stuff in Swing; I'm guessing
it's because the image isn't "ready" yet.
Also, I was wondering if it would be more efficient to store one
version of each unique graphic with the handler, perhaps in a hash
table keyed by the file name. If I have 100 locations, where 25 use
one graphic and 75 use another, wouldn't it be much more memory
efficient to store one copy of each and then link to that graphic?
Especially since when scaling URL Rasters, you should to save a copy
of the original scale.
-- Mark Bucciarelli <mbucciarelli@peregrine.com> R&D, Boston Peregrine Systems, Inc. http://www.peregrine.com (413) 253-0020 -- [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 Wed May 16 09:23:44 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT