62,622
社区成员
发帖
与我相关
我的任务
分享BufferedImage offImg;
if (offImg == null
|| offImg.getWidth() != d.width
|| offImg.getHeight() != d.height){
offImg = null;
offImg = new BufferedImage(
d.width, d.height, BufferedImage.TYPE_INT_RGB);
Graphics g2 = offImg.getGraphics();
g2.setColor(bgColor);
g2.fillRect(0,0,d.width,d.height);
drawBack(g2);
if (drawGrid)
drawBackGrid(g2);
}
Graphics g = this.getGraphics();
g.drawImage(offImg,0,0,d.width,d.height,null);