graphics.html.svn-base

来自「j2me设计的界面包」· SVN-BASE 代码 · 共 932 行 · 第 1/3 页

SVN-BASE
932
字号
<A NAME="drawLine(int, int, int, int)"><!-- --></A><H3>
drawLine</H3>
<PRE>
public void <B>drawLine</B>(int&nbsp;x1,
                     int&nbsp;y1,
                     int&nbsp;x2,
                     int&nbsp;y2)</PRE>
<DL>
<DD>Draws a line between the 2 X/Y coordinates
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x1</CODE> - first x position<DD><CODE>y1</CODE> - first y position<DD><CODE>x2</CODE> - second x position<DD><CODE>y2</CODE> - second y position</DL>
</DD>
</DL>
<HR>

<A NAME="fillRect(int, int, int, int)"><!-- --></A><H3>
fillRect</H3>
<PRE>
public void <B>fillRect</B>(int&nbsp;x,
                     int&nbsp;y,
                     int&nbsp;width,
                     int&nbsp;height)</PRE>
<DL>
<DD>Fills the rectangle from the given position according to the width/height minus 1 pixel according to the convnetion in Java.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the rectangle to be filled.<DD><CODE>y</CODE> - the y 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.</DL>
</DD>
</DL>
<HR>

<A NAME="drawRect(int, int, int, int)"><!-- --></A><H3>
drawRect</H3>
<PRE>
public void <B>drawRect</B>(int&nbsp;x,
                     int&nbsp;y,
                     int&nbsp;width,
                     int&nbsp;height)</PRE>
<DL>
<DD>Draws a rectangle in the given coordinates
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the rectangle to be drawn.<DD><CODE>y</CODE> - the y 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.</DL>
</DD>
</DL>
<HR>

<A NAME="drawRoundRect(int, int, int, int, int, int)"><!-- --></A><H3>
drawRoundRect</H3>
<PRE>
public void <B>drawRoundRect</B>(int&nbsp;x,
                          int&nbsp;y,
                          int&nbsp;width,
                          int&nbsp;height,
                          int&nbsp;arcWidth,
                          int&nbsp;arcHeight)</PRE>
<DL>
<DD>Draws a rounded corner rectangle in the given coordinates with the arcWidth/height matching the last two arguments respectively.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the rectangle to be drawn.<DD><CODE>y</CODE> - the y 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.</DL>
</DD>
</DL>
<HR>

<A NAME="fillRoundRect(int, int, int, int, int, int)"><!-- --></A><H3>
fillRoundRect</H3>
<PRE>
public void <B>fillRoundRect</B>(int&nbsp;x,
                          int&nbsp;y,
                          int&nbsp;width,
                          int&nbsp;height,
                          int&nbsp;arcWidth,
                          int&nbsp;arcHeight)</PRE>
<DL>
<DD>Fills a rounded rectangle in the same way as drawRoundRect
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the rectangle to be filled.<DD><CODE>y</CODE> - the y 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="../../../com/sun/lwuit/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="fillArc(int, int, int, int, int, int)"><!-- --></A><H3>
fillArc</H3>
<PRE>
public void <B>fillArc</B>(int&nbsp;x,
                    int&nbsp;y,
                    int&nbsp;width,
                    int&nbsp;height,
                    int&nbsp;startAngle,
                    int&nbsp;arcAngle)</PRE>
<DL>
<DD>Fills a circular or eliptical arc based on the given angles and bounding  box. The resulting arc begins at startAngle and extends for arcAngle  degrees.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the upper-left corner of the arc to be filled.<DD><CODE>y</CODE> - the y coordinate of the upper-left corner of the arc to be filled.<DD><CODE>width</CODE> - the width of the arc to be filled.<DD><CODE>height</CODE> - the height of the arc to be filled.<DD><CODE>startAngle</CODE> - the beginning angle.<DD><CODE>arcAngle</CODE> - the angular extent of the arc, relative to the start angle.</DL>
</DD>
</DL>
<HR>

<A NAME="drawArc(int, int, int, int, int, int)"><!-- --></A><H3>
drawArc</H3>
<PRE>
public void <B>drawArc</B>(int&nbsp;x,
                    int&nbsp;y,
                    int&nbsp;width,
                    int&nbsp;height,
                    int&nbsp;startAngle,
                    int&nbsp;arcAngle)</PRE>
<DL>
<DD>Draws a circular or eliptical arc based on the given angles and bounding  box
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the upper-left corner of the arc to be drawn.<DD><CODE>y</CODE> - the y coordinate of the upper-left corner of the arc to be drawn.<DD><CODE>width</CODE> - the width of the arc to be drawn.<DD><CODE>height</CODE> - the height of the arc to be drawn.<DD><CODE>startAngle</CODE> - the beginning angle.<DD><CODE>arcAngle</CODE> - the angular extent of the arc, relative to the start angle.</DL>
</DD>
</DL>
<HR>

<A NAME="drawString(java.lang.String, int, int)"><!-- --></A><H3>
drawString</H3>
<PRE>
public void <B>drawString</B>(java.lang.String&nbsp;str,
                       int&nbsp;x,
                       int&nbsp;y)</PRE>
<DL>
<DD>Draw a string using the current font and color in the x,y coordinates. The font is drawn from the top position and not the baseline.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - the string to be drawn.<DD><CODE>x</CODE> - the x coordinate.<DD><CODE>y</CODE> - the y coordinate.</DL>
</DD>
</DL>
<HR>

<A NAME="drawChar(char, int, int)"><!-- --></A><H3>
drawChar</H3>
<PRE>
public void <B>drawChar</B>(char&nbsp;character,
                     int&nbsp;x,
                     int&nbsp;y)</PRE>
<DL>
<DD>Draw the given char using the current font and color in the x,y  coordinates. The font is drawn from the top position and not the  baseline.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>character</CODE> - - the character to be drawn<DD><CODE>x</CODE> - the x coordinate of the baseline of the text<DD><CODE>y</CODE> - the y coordinate of the baseline of the text</DL>
</DD>
</DL>
<HR>

<A NAME="drawChars(char[], int, int, int, int)"><!-- --></A><H3>
drawChars</H3>
<PRE>
public void <B>drawChars</B>(char[]&nbsp;data,
                      int&nbsp;offset,
                      int&nbsp;length,
                      int&nbsp;x,
                      int&nbsp;y)</PRE>
<DL>
<DD>Draw the given char array using the current font and color in the x,y coordinates. The font is drawn from the top position and not the baseline.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - the array of characters to be drawn<DD><CODE>offset</CODE> - the start offset in the data<DD><CODE>length</CODE> - the number of characters to be drawn<DD><CODE>x</CODE> - the x coordinate of the baseline of the text<DD><CODE>y</CODE> - the y coordinate of the baseline of the text</DL>
</DD>
</DL>
<HR>

<A NAME="drawImage(com.sun.lwuit.Image, int, int)"><!-- --></A><H3>
drawImage</H3>
<PRE>
public void <B>drawImage</B>(<A HREF="../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit">Image</A>&nbsp;img,
                      int&nbsp;x,
                      int&nbsp;y)</PRE>
<DL>
<DD>Draws the image so its top left coordinate corresponds to x/y
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>img</CODE> - the specified image to be drawn. This method does  nothing if img is null.<DD><CODE>x</CODE> - the x coordinate.<DD><CODE>y</CODE> - the y coordinate.</DL>
</DD>
</DL>
<HR>

<A NAME="fillTriangle(int, int, int, int, int, int)"><!-- --></A><H3>
fillTriangle</H3>
<PRE>
public void <B>fillTriangle</B>(int&nbsp;x1,
                         int&nbsp;y1,
                         int&nbsp;x2,
                         int&nbsp;y2,
                         int&nbsp;x3,
                         int&nbsp;y3)</PRE>
<DL>
<DD>Draws a filled triangle with the given coordinates
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x1</CODE> - the x coordinate of the first vertex of the triangle<DD><CODE>y1</CODE> - the y coordinate of the first vertex of the triangle<DD><CODE>x2</CODE> - the x coordinate of the second vertex of the triangle<DD><CODE>y2</CODE> - the y coordinate of the second vertex of the triangle<DD><CODE>x3</CODE> - the x coordinate of the third vertex of the triangle<DD><CODE>y3</CODE> - the y coordinate of the third vertex of the triangle</DL>
</DD>
</DL>
<HR>

<A NAME="fillLinearGradient(int, int, int, int, int, int, boolean)"><!-- --></A><H3>
fillLinearGradient</H3>
<PRE>
public void <B>fillLinearGradient</B>(int&nbsp;startColor,
                               int&nbsp;endColor,
                               int&nbsp;x,
                               int&nbsp;y,
                               int&nbsp;width,
                               int&nbsp;height,
                               boolean&nbsp;horizontal)</PRE>
<DL>
<DD>Draws a linear gradient in the given coordinates with the given colors,  takes alpha into consideration when drawing the gradient
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>startColor</CODE> - the starting RGB color<DD><CODE>endColor</CODE> - the ending RGB color<DD><CODE>x</CODE> - the x coordinate<DD><CODE>y</CODE> - the y coordinate<DD><CODE>width</CODE> - the width of the region to be filled<DD><CODE>height</CODE> - the height of the region to be filled<DD><CODE>horizontal</CODE> - indicating wheter it is a horizontal fill or vertical</DL>
</DD>
</DL>
<HR>

<A NAME="fillRect(int, int, int, int, byte)"><!-- --></A><H3>
fillRect</H3>
<PRE>
public void <B>fillRect</B>(int&nbsp;x,
                     int&nbsp;y,
                     int&nbsp;w,
                     int&nbsp;h,
                     byte&nbsp;alpha)</PRE>
<DL>
<DD>Fills a rectangle with an optionally translucent fill color
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the rectangle to be filled<DD><CODE>y</CODE> - the y coordinate of the rectangle to be filled<DD><CODE>w</CODE> - the width of the rectangle to be filled<DD><CODE>h</CODE> - the height of the rectangle to be filled<DD><CODE>alpha</CODE> - the alpha values specify semitransparency</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Graphics.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/sun/lwuit/Form.html" title="class in com.sun.lwuit"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?com/sun/lwuit/Graphics.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Graphics.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?