µ±Ç°Î»Ö㺠´úÂëÃÔ >> JavaÏà¹Ø >> ΪʲôͼƬÎÞ·¨ÏÔʾ°¡
  Ïêϸ½â¾ö·½°¸

ΪʲôͼƬÎÞ·¨ÏÔʾ°¡

Èȶȣº411   ·¢²¼Ê±¼ä£º2006-05-13 17:45:00.0
ΪʲôͼƬÎÞ·¨ÏÔʾ°¡
package fish;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class internetfish extends JFrame{


public static void main(String []args){
internetfish fish=new internetfish();
fish.setVisible(true);
fish.getContentPane().add(new image2cvs());

}
}
class image2cvs extends Canvas{ //»­²¼
Image img,fish;
Image cacheimage;
Graphics gs;
image2cvs(){

setSize(800,478);
Toolkit tl=getToolkit();
img=tl.getImage("images/sea.jpg");//ÔØÈë±³¾°Í¼

}
public void paint(Graphics g){
int wt=getWidth();
int ht=getHeight();
cacheimage=createImage(wt,ht);
gs=cacheimage.getGraphics();
gs.drawImage(img,0,0,this);
}
}
ËÑË÷¸ü¶àÏà¹ØµÄ½â¾ö·½°¸: fish  import  awt  java  

----------------½â¾ö·½°¸--------------------------------------------------------
public void paint(Graphics g){
ÄãÖ±½ÓÓÃgÀ´»æÖƲ»¾Í¿ÉÒÔÁËÂð
----------------½â¾ö·½°¸--------------------------------------------------------
  Ïà¹Ø½â¾ö·½°¸