一个JAVA图像编程程序:绘制房子,请大虾给点注释,本人是初学者,谢谢!
// Source File Name: house.java
import java.applet.Applet;
import java.awt.*;
public class house extends Applet
{
public void init()
{
setBackground(Color.black);
}
public void paint(Graphics g)
{
byte byte0 = 110;
byte byte1 = 95;
showStatus( "My Homepage ");
calc(g, 16, byte0, byte1, 0, 0, 0);
}
static void calc(Graphics g, int i, int j, int k, int l, int i1, int j1)
{
int k1 = i1;
int l1 = l;
int i2 = j1;
int j2 = i;
int k2 = l + i;
int l2 = i1 + i;
int i3 = j1 + i;
int j3 = j2 < < 1;
int k3 = j3 < < 1;
for(int l3 = 0; l3 < 8; l3++)
{
if(l3 == 1)
{
j -= j3;
k += j2;
l1 = k2;
}
if(l3 == 2)
{
j += k3;
l1 = l;
k1 = l2;