There are 2 ways right now.
1. The renderer API has a render( graphics2d ); method that will
render that layer to the graphics2D object. You can get a renderer
from the RenderManager.getRenderers(). You can create your own
BufferedImage. Create a graphics2D from it and render to that
image. This is the recommended method.
2. The second way is to call renderer.getContext().getImage(). For
this version and the previous version this will return the last
rendering of the layer. But this is not guaranteed to do so in
future versions. We have has some complaints about the amount of
memory a separate buffered image for renderer takes up. So we will
probably add different configurations that do not do the caching.
Hope this helps,
Jesse
On 22-Mar-06, at 3:59 PM, Christopher Hammack wrote:
I've been getting the raw Image object (BufferedImages) from Maps for
use in export to other mediums.
Is there a way to get images of individual layers (e.g. if I have a
shapefile layer and a raster layer, and I want the image of the
shapefile layer only)? As a workaround, I can create separate maps
for
each layer, but that is not ideal.
Thanks!
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel