zgfp.net
当前位置:首页 >> grAphiCs2D FillrECt >>

grAphiCs2D FillrECt

public class test8888 extends JPanel { Polygon po = new Polygon(); Font fn = new Font("宋体", Font.BOLD, 22); Font fn2 = new Font("宋体", Font.BOLD, 20); int x = 100; int y = 100; int[] pox ={ 90, 100, 100 }; int[] poy ={ 110, ...

一般都用那个bufferImage,下面是一个例子程序: img = ImageIO.read(new File("img1.jpg")); int width=img.getWidth(); int height=img.getHeight(); int type = img.getColorModel().getTransparency(); BufferedImage image1 = new Buffered...

public void paint(Graphics g){ Graphics2D g2=(Graphics2D)g; g2.setColor(Color.blue); g2.fillRect(fg.getx(), fg.gety(), h, w); } 然后我用key...

public void paint(Graphics g){ Graphics2D g2=(Graphics2D)g; //加上以下两句,将背景重绘 g2.setColor(getContentPane().getBackground()); g2.fillRect(0...

假如你想在某个JPanel上画图,可以这样写: private JPanel canvas;//画布 private Graphics2D pen;//绘图工具 private void init(){ canvas = new JPanel(); //以下是画一个白色棋子 pen = (Graphics2D)canvas.getGraphics(); pen.setColor(new...

public void paint(Graphics g){ Graphics2D g2=(Graphics2D)g; g2.setColor(Color.blue); g2.fillRect(fg.getx(), fg.gety(), h, w); }然后我用keypr...

网站首页 | 网站地图
All rights reserved Powered by www.zgfp.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com