Embed presentation
Download to read offline
![Npm : 201243501150
Nama : Dita Erlita Sari
Kelas : R7H
Mata Kuliah : Komputer Grafik
Dosen : Nahot Frastian , M.Kom
Program Studi : Teknik Informatika
Universitas : Universitas Indraprasta PGRI
Program Komputer Grafik :
MyPoly
Input :
import java.awt.Graphics ;
import java.awt.Color ;
public class MyPoly extends java.applet.Applet {
public void paint ( Graphics g ) {
int xpts [] = {39,94,97,142,53,58,26};
int ypts [] = {33,74,36,70,108,80,106};
int pts = xpts.length;
g.drawPolygon ( xpts , ypts , pts ) ;
// g.fillPolygon ( xpts , ypts , pts ) ;
//Polygon poly = new Polygon ( xpts , ypts , pts ) ;
}
}](https://image.slidesharecdn.com/mypoly-151210122720/75/My-poly-1-2048.jpg)
![Output:
Proses :
drawPolygonnya menggunakan nilai = xpts , ypts , pts
dengan nilai array pada xpts [] = {39,94,97,142,53,58,26} , ypts [] =
{33,74,36,70,108,80,106};](https://image.slidesharecdn.com/mypoly-151210122720/75/My-poly-2-2048.jpg)

This document contains information about a student named Dita Erlita Sari who is taking a Computer Graphics course. The document lists her student ID, class, course, instructor, study program at the University of Indraprasta PGRI. It also contains sample code to draw a polygon using the drawPolygon method in Java.
![Npm : 201243501150
Nama : Dita Erlita Sari
Kelas : R7H
Mata Kuliah : Komputer Grafik
Dosen : Nahot Frastian , M.Kom
Program Studi : Teknik Informatika
Universitas : Universitas Indraprasta PGRI
Program Komputer Grafik :
MyPoly
Input :
import java.awt.Graphics ;
import java.awt.Color ;
public class MyPoly extends java.applet.Applet {
public void paint ( Graphics g ) {
int xpts [] = {39,94,97,142,53,58,26};
int ypts [] = {33,74,36,70,108,80,106};
int pts = xpts.length;
g.drawPolygon ( xpts , ypts , pts ) ;
// g.fillPolygon ( xpts , ypts , pts ) ;
//Polygon poly = new Polygon ( xpts , ypts , pts ) ;
}
}](https://image.slidesharecdn.com/mypoly-151210122720/75/My-poly-1-2048.jpg)
![Output:
Proses :
drawPolygonnya menggunakan nilai = xpts , ypts , pts
dengan nilai array pada xpts [] = {39,94,97,142,53,58,26} , ypts [] =
{33,74,36,70,108,80,106};](https://image.slidesharecdn.com/mypoly-151210122720/75/My-poly-2-2048.jpg)
