Image image = new Image(Display.getDefault(), width, height);
SimpleFeature feature = sampleFeature(layer);
ViewportGraphics graphics = Drawing.createGraphics(new GC(image), Display.getDefault(),
new Dimension(width - 1, width - 1));
graphics.clearRect(0, 0, width, height);
// graphics.clearRect(0,0,16,16);
AffineTransform transform = Drawing.worldToScreenTransform(feature.getBounds(),
new Rectangle(1, 0, width - 1, width - 1));
// Drawing.createGraphics(image.createGraphics());
Drawing.create().drawFeature(graphics, feature, transform, styleObject);