import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.imageio.ImageIO;
import java.awt.image.*;
class pic extends Frame{
Image img;
double th1[]=new double[6];
double th2[]=new double[6];
double c[][]=new double[6][6];
double y1[][]=new double[6][6];
double y2[][]=new double[6][6];
int p1,s1,s2,s3,h;
String str;
int x1,x2,z1,z2;
void makedata(){
BufferedImage readImage = null;
if (readImage == null){
readImage = new BufferedImage(700,700,BufferedImage.TYPE_INT_BGR); }
Graphics2D off = readImage.createGraphics();
off.setColor(Color.yellow);
off.fillRect(0,0,700,700);
off.setColor(Color.blue);
off.drawLine(100,600,600,600);
off.drawLine(100,600,100,100);
off.drawString("夫の能力",300,650);
off.drawString("夫の所得",20,200);
s2=1;
for(s1=1;s1<5;s1++){
z1=(int)(600-500*y1[s1][s2]);
x1=(int)(100+500*th1[s1]);
z2=(int)(600-500*y1[s1+1][s2]);
x2=(int)(100+500*th1[s1+1]);
off.drawLine(x1,z1,x2,z2);
}
off.setColor(Color.red);
s2=5;
for(s1=1;s1<5;s1++){
z1=(int)(600-500*y1[s1][s2]);
x1=(int)(100+500*th1[s1]);
z2=(int)(600-500*y1[s1+1][s2]);
x2=(int)(100+500*th1[s1+1]);
off.drawLine(x1,z1,x2,z2);
}
off.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
BasicStroke wideStroke = new BasicStroke(2.0f);
off.setStroke(wideStroke);
try {
boolean result = ImageIO.write(readImage, "jpg", new File("sam.jpg"));
} catch (Exception e) { e.printStackTrace(); }
}
}
最終更新:2011年08月12日 14:43