¤¿¤Þ¤Ë¤Ã¤¡£ / 2001-10-27
| Æü | ·î | ²Ð | ¿å | ÌÚ | ¶â | ÅÚ |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
2001-10-27 Sat
¢£ ¥Õ¥ì¡¼¥à¤Î¥¥ã¥×¥Á¥ã
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
class FrameCapture extends Frame{
public FrameCapture(){
Button capture = new Button("Capture");
setLayout(new FlowLayout());
add(capture);
capture.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
try{
Image img = new BufferedImage(getWidth(), getHeight(),
BufferedImage.TYPE_INT_ARGB);
Graphics g = img.getGraphics();
paint(g);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(new FileOutputStream("aaa.jpg"));
encoder.encode(img);
} catch(Exception e){
e.printStackTrace();
}
}
});
}
public void update(Graphics g){
paint(g);
}
public static void main(String[] args){
FrameCapture f = new FrameCapture();
f.setSize(400, 400);
f.setVisible(true);
Graphics g = f.getGraphics();
g.drawLine(0, 0, 100, 200);
g.drawRect(10, 20, 200, 150);
}
}
¤³¤ó¤Ê¤ó¤ÇÂç¾æÉפΤϤº
Category: [Java]
[ ¸ÇÄê¥ê¥ó¥¯ |
¥³¥á¥ó¥È |
¥È¥é¥Ã¥¯¥Ð¥Ã¥¯ ()
|
]
[
¥³¥á¥ó¥È |
¥È¥é¥Ã¥¯¥Ð¥Ã¥¯
()
]
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
2004 : 01 02 03 04 05 06 07 08 09 10 11 12
2003 : 01 02 03 04 05 06 07 08 09 10 11 12
2002 : 01 02 03 04 05 06 07 08 09 10 11 12
2001 : 01 02 03 04 05 06 07 08 09 10 11 12
ºÇ½ª¹¹¿·»þ´Ö: 2008-09-04 19:19





