java中双缓冲

来源:互联网 发布:矩阵关联分析法 编辑:程序博客网 时间:2024/06/09 16:30
public void paint(Graphics g) {// TODO Auto-generated method stub
//Image = new BufferedImage(this.getWidth(),this.getHeight(), BufferedImage.TYPE_INT_ARGB) ;Graphics buffG = buffImg.getGraphics() ;buffG.drawImage(bImg, mapx, mapy,null) ;buffG.drawImage(hImg, px, py, null) ;buffG.dispose();g.drawImage(buffImg, 0, 0, null) ;}
<span style="font-family:Arial;background-color: rgb(255, 255, 255);">做法就是讲所有要画的东西先画在一个 image上,然后在吧这个image 画上去。</span>
0 0
原创粉丝点击