2012-06-12 39 views

回答

1

在鏈接的文章中使用ImageUtilities效果很好。以下是如何在標籤中使用它。

@Override 
protected void paintFigure(Graphics graphics) { 
    if (vertical) { 
     Image image = ImageUtilities.createRotatedImageOfString(getSubStringText(), getFont(), getForegroundColor(), getBackgroundColor()); 
     graphics.drawImage(image, new Point(getTextLocation()).translate(getLocation())); 
    image.dispose(); 
    } else { 
     super.paintFigure(graphics); 
    } 
} 
+0

緩存圖像並僅在處理標籤時處置它會是一種好的做法嗎?哪種方法最適合處理圖像?標籤#的removeNotify? – lolung