Simple GIS

GISプログラムの練習

kao

package face4;

import java.awt.*; 
import java.awt.image.*; 
import java.awt.event.*;

class pro extends Frame{ 
PixelGrabber pg; 
Color col; 
Image img; 
int w=300; 
int h=365; 
int red,green,blue; 
int pix=new int[w*h]; 
int memor=new int[h][w]; 
int memog=new int[h][w]; 
int memob=new int[h][w]; 
int mx,nx,m,n; 
int x,y,w1,h1,rx,ry,lx,ly; 
String pic; 

public static void main(String args) { 
pro f = new pro(); 
f.setSize(700,700); 
f.setBackground(Color.blue) ; 
f.setVisible(true); 
f.addWindowListener(new WindowAdapter(){public void 
windowClosing(WindowEvent e){System.exit(0);}}); 
} 

pro(){ 
 
pic="http://img.ske48.co.jp/profile/large/matsui_rena.jpg";

catchimg sub=new catchimg();
sub.makedata(pic);
memor=sub.memor;
memog=sub.memog;
memob=sub.memob;

catchdata sub2=new catchdata();
sub2.makedata(pic);
x=sub2.x;
y=sub2.y;
w1=sub2.w;
h1=sub2.h;
rx=sub2.rx;
ry=sub2.ry;
lx=sub2.lx;
ly=sub2.ly;


} 


public void paint( Graphics g ) { 
g.setColor(Color.blue); 
g.fillRect(0,0,700,700); 

for (mx=0;mx<h;mx++){ 
for (nx=0;nx<w;nx++){ 
g.setColor(new Color(memor[mx][nx],memog[mx][nx],memob[mx][nx]));   
g.fillRect(100+nx,100+mx,1,1); 
} 
} 

g.setColor(Color.red);  
g.fillRect(100+lx,100+ly,5,5); 

} 





}