Hi,

If you mean just with java (not geotools as mentioned previously) you
could do something like this...

import com.vividsolutions.jts.geom.Geometry;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

// in your drawing method...
        int imgWidth = ...;
        int imgHeight = ...;
        BufferedImage buffImg = new BufferedImage(imgWidth, imgHeight,
BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = buffImg.createGraphics();
        g2.setBackground(Color.WHITE);
        g2.setColor(Color.BLUE);

        // draw each Geometry e.g by getting Coordinates and using g2.drawLine
        // 
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#getCoordinates()

        // finished drawing: save to file
        try {
                ImageIO.write(buffImg, "PNG", new
File("c:\\my\\dir\\myfile.png"));
        } catch (IOException ex) {
            // bummer...
        }


Michael

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to