顺便请教一个JAI的问题, 通过PlanarImage对象怎么得到Graphics对象啊?我直接使用planarImage.getGraphics();就报以下异常: Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: getGraphics() is not implemented in this class.现在只能先使用planarImage.getAsBufferedImage();将PlanarImage转换成BufferedImage再得Graphics对象,不过这样就会多占一块内存,对速度也有影响。
但是你可以试试把上面的颜色alpha设成50%透明
用异或的方式画时,上面的内容就会自己根据背景色是什么来变色的。如果你能直接用异或方式画满足要求的话,那就直接后面的圆画的时候设为异或模式,如果不能,就研究一下它异或画法的代码吧。
g.setXORMode(Color)
画圆的时候,就会有锯齿,java画图有去锯齿的功能的
我正在做绘图方面的程序,可以交流
通过PlanarImage对象怎么得到Graphics对象啊?我直接使用planarImage.getGraphics();就报以下异常:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalAccessError: getGraphics() is not implemented in this class.现在只能先使用planarImage.getAsBufferedImage();将PlanarImage转换成BufferedImage再得Graphics对象,不过这样就会多占一块内存,对速度也有影响。