You are on page 1of 5

OUTPUT:-

Enter the Choice:1


Enter the Choice:2

Enter the Choice:3

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();

private Image image1 = new ImageIcon("C:/Users/91807/Desktop/cd.gif").getImage();

public Park() {
setBounds(100, 100, frameWidth, frameHeight);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}

public void paint(Graphics g) {

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();
}
}

You might also like