Computer Graphics Record
Computer Graphics Record
RESULT:
Thus the program implementation of Midpoint algorithm for line, circle and ellipse drawing is done
successfully
OUTPUT:-
RESULT:
Thus the program implementation of Sutherland Hodgeman algorithm for polygon fill and clip the polygon is
done successfully
PROGRAM:
import javax.swing.*;
import java.awt.*;
import java.util.concurrent.TimeUnit;
public class Park extends JFrame {
private int frameWidth = 700, frameHeight = 500;
private Image image = new ImageIcon("F:/abc.jpg").getImage();
public Park() {
setBounds(100, 100, frameWidth, frameHeight);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
g.drawImage(image, 0,0,getWidth(),getHeight(),this);
for(int i=0;i<=getWidth();i++)
{
g.drawImage(image, 0,0,getWidth(),getHeight(),this);
g.drawImage(image1, i,getHeight()-100,100,100,this);
try
{
Thread.sleep(10);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
}
}
public static void main(String args[]) {
new Park();
}
}