import java.awt.*;
import java.awt.event.*;
class game extends Frame{
int w;
int h;
int memor[][]=new int[1000][1000];
int memog[][]=new int[1000][1000];
int memob[][]=new int[1000][1000];
int hr[]=new int[300];
int hg[]=new int[300];
int hb[]=new int[300];
int mx,nx,m1;
String str;
public static void main(String[] args) {
game f = new game();
f.setSize(700,700);
f.setBackground(Color.blue) ;
f.setVisible(true);
f.addWindowListener(new WindowAdapter(){public void
windowClosing(WindowEvent e){System.exit(0);}});
}
game() {
w=300;
h=225;
str="airi.jpg";
catchimg sub=new catchimg();
sub.makedata(str,w,h);
memor=sub.memor;
memog=sub.memog;
memob=sub.memob;
for (mx=0;mx<h;mx++){
for (nx=0;nx<w;nx++){
m1=memor[mx][nx];
hr[m1]=hr[m1]+1;
}
}
}
public void paint( Graphics g ) {
int i,z,pp;
g.setColor(Color.blue);
g.fillRect(0,0,700,700);
for (nx=0;nx<256;nx++){
g.setColor(Color.red);
g.fillRect(100+nx,600-hr[nx],1,hr[nx]);
}
}
}
最終更新:2011年08月03日 04:16