The graphic context maintains states (or attributes) such as the current painting color, the current font for drawing text strings, and the current painting rectangular area (called clip). Graphics Class' Methods for Maintaining the Graphics Context Shapes with negative width and height will not be painted. The drawXxx() methods draw the outlines while fillXxx() methods fill the internal. These drawing methods is illustrated below. Drawing (or printing) texts on the graphics screen:ĭrawString(String str, int xBaselineLeft, int yBaselineLeft) ĭrawLine(int x1, int y1, int x2, int y2) ĭrawPolyline(int xPoints, int yPoints, int numPoint) ĭrawRect(int xTopLeft, int yTopLeft, int width, int height) ĭrawOval(int xTopLeft, int yTopLeft, int width, int height) ĭrawArc(int xTopLeft, int yTopLeft, int width, int height, int startAngle, int arcAngle) ĭraw3DRect(int xTopLeft, int, yTopLeft, int width, int height, boolean raised) ĭrawRoundRect(int xTopLeft, int yTopLeft, int width, int height, int arcWidth, int arcHeight)ĭrawPolygon(int xPoints, int yPoints, int numPoint) įillRect(int xTopLeft, int yTopLeft, int width, int height) įillOval(int xTopLeft, int yTopLeft, int width, int height) įillArc(int xTopLeft, int yTopLeft, int width, int height, int startAngle, int arcAngle) įill3DRect(int xTopLeft, int, yTopLeft, int width, int height, boolean raised) įillRoundRect(int xTopLeft, int yTopLeft, int width, int height, int arcWidth, int arcHeight)įillPolygon(int xPoints, int yPoints, int numPoint) ĭrawImage(Image img, int xTopLeft, int yTopLeft, ImageObserver obs) // draw image with its sizeĭrawImage(Image img, int xTopLeft, int yTopLeft, int width, int height, ImageObserver o) // resize image on screen Bitmap images: via the drawImage() method.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |