如何不绘制背景图像的某个部分?

问题描述

图片绘制到面板的代码

public class MyDraw extends JPanel {
  background = new ImageIcon("src/background.jpg").getimage();
@Override
    protected void paintComponent(Graphics gr){
 super.paintComponent(gr);
 gr.drawImage(background,800,600,null);

}
}

我不想在这个圆圈里画背景图片,因为我想看到这个圆圈后面的物体。 我不想将对象放在图像的前面,因为按 WASD 会移动圆圈。

像这样: see image by clicking here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)