graphics.html
来自「API資料大全」· HTML 代码 · 共 1,336 行 · 第 1/5 页
HTML
1,336 行
<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#getClip()"><CODE>getClip()</CODE></A>, <A HREF="../../java/awt/Graphics.html#clipRect(int, int, int, int)"><CODE>clipRect(int, int, int, int)</CODE></A>, <A HREF="../../java/awt/Graphics.html#setClip(int, int, int, int)"><CODE>setClip(int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="copyArea(int, int, int, int, int, int)"><!-- --></A><H3>copyArea</H3><PRE>public abstract void <B>copyArea</B>(int x, int y, int width, int height, int dx, int dy)</PRE><DL><DD>Copies an area of the component by a distance specified by <code>dx</code> and <code>dy</code>. From the point specified by <code>x</code> and <code>y</code>, this method copies downwards and to the right. To copy an area of the component to the left or upwards, specify a negative value for <code>dx</code> or <code>dy</code>. If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, <code>copyArea</code> will be unable to copy the associated pixels. The area that is omitted can be refreshed by calling the component's <code>paint</code> method.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the source rectangle.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the source rectangle.<DD><CODE>width</CODE> - the width of the source rectangle.<DD><CODE>height</CODE> - the height of the source rectangle.<DD><CODE>dx</CODE> - the horizontal distance to copy the pixels.<DD><CODE>dy</CODE> - the vertical distance to copy the pixels.</DL></DD></DL><HR><A NAME="drawLine(int, int, int, int)"><!-- --></A><H3>drawLine</H3><PRE>public abstract void <B>drawLine</B>(int x1, int y1, int x2, int y2)</PRE><DL><DD>Draws a line, using the current color, between the points <code>(x1, y1)</code> and <code>(x2, y2)</code> in this graphics context's coordinate system.<DD><DL><DT><B>Parameters:</B><DD><CODE>x1</CODE> - the first point's <i>x</i> coordinate.<DD><CODE>y1</CODE> - the first point's <i>y</i> coordinate.<DD><CODE>x2</CODE> - the second point's <i>x</i> coordinate.<DD><CODE>y2</CODE> - the second point's <i>y</i> coordinate.</DL></DD></DL><HR><A NAME="fillRect(int, int, int, int)"><!-- --></A><H3>fillRect</H3><PRE>public abstract void <B>fillRect</B>(int x, int y, int width, int height)</PRE><DL><DD>Fills the specified rectangle. The left and right edges of the rectangle are at <code>x</code> and <code>x + width - 1</code>. The top and bottom edges are at <code>y</code> and <code>y + height - 1</code>. The resulting rectangle covers an area <code>width</code> pixels wide by <code>height</code> pixels tall. The rectangle is filled using the graphics context's current color.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the rectangle to be filled.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the rectangle to be filled.<DD><CODE>width</CODE> - the width of the rectangle to be filled.<DD><CODE>height</CODE> - the height of the rectangle to be filled.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#clearRect(int, int, int, int)"><CODE>clearRect(int, int, int, int)</CODE></A>, <A HREF="../../java/awt/Graphics.html#drawRect(int, int, int, int)"><CODE>drawRect(int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="drawRect(int, int, int, int)"><!-- --></A><H3>drawRect</H3><PRE>public void <B>drawRect</B>(int x, int y, int width, int height)</PRE><DL><DD>Draws the outline of the specified rectangle. The left and right edges of the rectangle are at <code>x</code> and <code>x + width</code>. The top and bottom edges are at <code>y</code> and <code>y + height</code>. The rectangle is drawn using the graphics context's current color.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the rectangle to be drawn.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the rectangle to be drawn.<DD><CODE>width</CODE> - the width of the rectangle to be drawn.<DD><CODE>height</CODE> - the height of the rectangle to be drawn.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#fillRect(int, int, int, int)"><CODE>fillRect(int, int, int, int)</CODE></A>, <A HREF="../../java/awt/Graphics.html#clearRect(int, int, int, int)"><CODE>clearRect(int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="clearRect(int, int, int, int)"><!-- --></A><H3>clearRect</H3><PRE>public abstract void <B>clearRect</B>(int x, int y, int width, int height)</PRE><DL><DD>Clears the specified rectangle by filling it with the background color of the current drawing surface. This operation does not use the current paint mode. <p> Beginning with Java 1.1, the background color of offscreen images may be system dependent. Applications should use <code>setColor</code> followed by <code>fillRect</code> to ensure that an offscreen image is cleared to a specific color.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the rectangle to clear.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the rectangle to clear.<DD><CODE>width</CODE> - the width of the rectangle to clear.<DD><CODE>height</CODE> - the height of the rectangle to clear.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#fillRect(int, int, int, int)"><CODE>fillRect(int, int, int, int)</CODE></A>, <A HREF="../../java/awt/Graphics.html#drawRect(int, int, int, int)"><CODE>drawRect(int, int, int, int)</CODE></A>, <A HREF="../../java/awt/Graphics.html#setColor(java.awt.Color)"><CODE>setColor(java.awt.Color)</CODE></A>, <A HREF="../../java/awt/Graphics.html#setPaintMode()"><CODE>setPaintMode()</CODE></A>, <A HREF="../../java/awt/Graphics.html#setXORMode(java.awt.Color)"><CODE>setXORMode(java.awt.Color)</CODE></A></DL></DD></DL><HR><A NAME="drawRoundRect(int, int, int, int, int, int)"><!-- --></A><H3>drawRoundRect</H3><PRE>public abstract void <B>drawRoundRect</B>(int x, int y, int width, int height, int arcWidth, int arcHeight)</PRE><DL><DD>Draws an outlined round-cornered rectangle using this graphics context's current color. The left and right edges of the rectangle are at <code>x</code> and <code>x + width</code>, respectively. The top and bottom edges of the rectangle are at <code>y</code> and <code>y + height</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the rectangle to be drawn.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the rectangle to be drawn.<DD><CODE>width</CODE> - the width of the rectangle to be drawn.<DD><CODE>height</CODE> - the height of the rectangle to be drawn.<DD><CODE>arcWidth</CODE> - the horizontal diameter of the arc at the four corners.<DD><CODE>arcHeight</CODE> - the vertical diameter of the arc at the four corners.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#fillRoundRect(int, int, int, int, int, int)"><CODE>fillRoundRect(int, int, int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="fillRoundRect(int, int, int, int, int, int)"><!-- --></A><H3>fillRoundRect</H3><PRE>public abstract void <B>fillRoundRect</B>(int x, int y, int width, int height, int arcWidth, int arcHeight)</PRE><DL><DD>Fills the specified rounded corner rectangle with the current color. The left and right edges of the rectangle are at <code>x</code> and <code>x + width - 1</code>, respectively. The top and bottom edges of the rectangle are at <code>y</code> and <code>y + height - 1</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the rectangle to be filled.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the rectangle to be filled.<DD><CODE>width</CODE> - the width of the rectangle to be filled.<DD><CODE>height</CODE> - the height of the rectangle to be filled.<DD><CODE>arcWidth</CODE> - the horizontal diameter of the arc at the four corners.<DD><CODE>arcHeight</CODE> - the vertical diameter of the arc at the four corners.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#drawRoundRect(int, int, int, int, int, int)"><CODE>drawRoundRect(int, int, int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="draw3DRect(int, int, int, int, boolean)"><!-- --></A><H3>draw3DRect</H3><PRE>public void <B>draw3DRect</B>(int x, int y, int width, int height, boolean raised)</PRE><DL><DD>Draws a 3-D highlighted outline of the specified rectangle. The edges of the rectangle are highlighted so that they appear to be beveled and lit from the upper left corner. <p> The colors used for the highlighting effect are determined based on the current color. The resulting rectangle covers an area that is <code>width + 1</code> pixels wide by <code>height + 1</code> pixels tall.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the rectangle to be drawn.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the rectangle to be drawn.<DD><CODE>width</CODE> - the width of the rectangle to be drawn.<DD><CODE>height</CODE> - the height of the rectangle to be drawn.<DD><CODE>raised</CODE> - a boolean that determines whether the rectangle appears to be raised above the surface or sunk into the surface.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#fill3DRect(int, int, int, int, boolean)"><CODE>fill3DRect(int, int, int, int, boolean)</CODE></A></DL></DD></DL><HR><A NAME="fill3DRect(int, int, int, int, boolean)"><!-- --></A><H3>fill3DRect</H3><PRE>public void <B>fill3DRect</B>(int x, int y, int width, int height, boolean raised)</PRE><DL><DD>Paints a 3-D highlighted rectangle filled with the current color. The edges of the rectangle will be highlighted so that it appears as if the edges were beveled and lit from the upper left corner. The colors used for the highlighting effect will be determined from the current color.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the rectangle to be filled.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the rectangle to be filled.<DD><CODE>width</CODE> - the width of the rectangle to be filled.<DD><CODE>height</CODE> - the height of the rectangle to be filled.<DD><CODE>raised</CODE> - a boolean value that determines whether the rectangle appears to be raised above the surface or etched into the surface.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#draw3DRect(int, int, int, int, boolean)"><CODE>draw3DRect(int, int, int, int, boolean)</CODE></A></DL></DD></DL><HR><A NAME="drawOval(int, int, int, int)"><!-- --></A><H3>drawOval</H3><PRE>public abstract void <B>drawOval</B>(int x, int y, int width, int height)</PRE><DL><DD>Draws the outline of an oval. The result is a circle or ellipse that fits within the rectangle specified by the <code>x</code>, <code>y</code>, <code>width</code>, and <code>height</code> arguments. <p> The oval covers an area that is <code>width + 1</code> pixels wide and <code>height + 1</code> pixels tall.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the upper left corner of the oval to be drawn.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the upper left corner of the oval to be drawn.<DD><CODE>width</CODE> - the width of the oval to be drawn.<DD><CODE>height</CODE> - the height of the oval to be drawn.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#fillOval(int, int, int, int)"><CODE>fillOval(int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="fillOval(int, int, int, int)"><!-- --></A><H3>fillOval</H3><PRE>public abstract void <B>fillOval</B>(int x, int y, int width, int height)</PRE><DL><DD>Fills an oval bounded by the specified rectangle with the current color.<DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the <i>x</i> coordinate of the upper left corner of the oval to be filled.<DD><CODE>y</CODE> - the <i>y</i> coordinate of the upper left corner of the oval to be filled.<DD><CODE>width</CODE> - the width of the oval to be filled.<DD><CODE>height</CODE> - the height of the oval to be filled.<DT><B>See Also: </B><DD><A HREF="../../java/awt/Graphics.html#drawOval(int, int, int, int)"><CODE>drawOval(int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="drawArc(int, int, int, int, int, int)"><!-- --></A><H3>drawArc</H3><PRE>public abstract void <B>drawArc</B>(int x, int y, int width, int height, int startAngle, int arcAngle)</PRE><DL><DD>Draws the outline of a circular or elliptical arc covering the specified rectangle. <p
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?