Hi,

Please somebody tell me whats wrong in my code! 
Instead images in my application displayed gray squares (
Here is my code:


public static Style getPointStyle() {
    StyleBuilder styleBuilder = new StyleBuilder();
    Style style = styleBuilder.createStyle();
    {
        {   
            PointSymbolizer pointSymbolizer =
styleBuilder.createPointSymbolizer();
            {    
                Graphic graphic = styleBuilder.createGraphic();
                File file       =       new File( "d:/pan.png");
                if( !file.exists() )    logger.error("file not found");
                ExternalGraphic external =
styleBuilder.createExternalGraphic( "file:///" + file, "image/png");
                graphic.graphicalSymbols().add( external );
                pointSymbolizer.setGraphic(graphic);
            }
            Rule rule = styleBuilder.createRule(pointSymbolizer);
            FeatureTypeStyle featureTypeStyle =
styleBuilder.createFeatureTypeStyle("Feature", rule );
            style.featureTypeStyles().add( featureTypeStyle );
        }
    }
}


Thank you very much,
Michael Grain
-- 
View this message in context: 
http://n2.nabble.com/ExternalGraphics-gray-squares-instead-images-tp4914506p4914506.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to