【正文】
startAngle, int arcAngle) ? void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) ? void drawOval(int x, int y, int width, int height) ? void fillOval(int x, int y, int width, int height) 29 Applet小程序 import 。 public class Exam4_8 extends Applet { public void paint(Graphics g) { int x0 =10, y0=20, X=150, Y=80, L, c。 double xy=*(XY)/N/2。 (x0, y0, X, X)。 i =N。 arc=Y*i/N。 (new Color(c, c, c))。 } ()。 ()。 } } 30 Applet小程序 Html Body Applet code= width=500 height=300 /Applet /Body /Html 31 繪制圖形 4. 繪制幾何圖形 ? 畫多邊形 ? public void drawPolygon(int xPoints[], int yPoints[], int Points) ? public void fillPolygon(int xPoints[], int yPoints[], int Points) ? public void drawPolygon(Polygon p) ? public void fillPolygon(Polygon p) ? Polygon類構(gòu)造方法 ? Polygon() ? Polygon(int xPoints[], int yPoints[], int numberOfPoints) 32 演示圖像 1. 定義圖像對象 ? ? 圖像高度和寬度 ? int getHeight(ImageObserver observer) ? int getWidth(ImageObserver observer) 2. 獲取圖像信息方法 ? Image getImage(URL url, String name) 3. 顯示圖像的操作 ? drawImage(Image img, int x, int y, ImageObserver observer) ? drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) 33 Applet小程序 import 。 public class Exam4_13 extends Applet { public void paint(Graphics g) { Image pic。 int x0 = 10, y0 = 30。 int h = (this)。 (pic, x0+150, y0, w/12, h/12, this)。 (pic, x0+250, y0+30, (int)(w*), (int)(h*), this