📄 graphics.html
字号:
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#getStrokeStyle()">getStrokeStyle</A></B>()</CODE><BR> Gets the stroke style used for drawing operations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#getTranslateX()">getTranslateX</A></B>()</CODE><BR> Gets the X coordinate of the translated origin of this graphics context.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#getTranslateY()">getTranslateY</A></B>()</CODE><BR> Gets the Y coordinate of the translated origin of this graphics context.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#setClip(int, int, int, int)">setClip</A></B>(int x, int y, int width, int height)</CODE><BR> Sets the current clip to the rectangle specified by the given coordinates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#setColor(int)">setColor</A></B>(int RGB)</CODE><BR> Sets the current color to the specified RGB values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#setColor(int, int, int)">setColor</A></B>(int red, int green, int blue)</CODE><BR> Sets the current color to the specified RGB values.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#setFont(javax.microedition.lcdui.Font)">setFont</A></B>(<A HREF="../../../javax/microedition/lcdui/Font.html">Font</A> font)</CODE><BR> Sets the font for all subsequent text rendering operations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#setGrayScale(int)">setGrayScale</A></B>(int value)</CODE><BR> Sets the current grayscale to be used for all subsequent rendering operations.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#setStrokeStyle(int)">setStrokeStyle</A></B>(int style)</CODE><BR> Sets the stroke style used for drawing lines, arcs, rectangles, and rounded rectangles.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Graphics.html#translate(int, int)">translate</A></B>(int x, int y)</CODE><BR> Translates the origin of the graphics context to the point <code>(x, y)</code> in the current coordinate system.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="HCENTER"><!-- --></A><H3>HCENTER</H3><PRE>public static final int <B>HCENTER</B></PRE><DL><DD>Constant for centering text and images horizontally around the anchor point <P>Value <code>1</code> is assigned to <code>HCENTER</code>.</P></DL><HR><A NAME="VCENTER"><!-- --></A><H3>VCENTER</H3><PRE>public static final int <B>VCENTER</B></PRE><DL><DD>Constant for centering images vertically around the anchor point. <P>Value <code>2</code> is assigned to <code>VCENTER</code>.</P></DL><HR><A NAME="LEFT"><!-- --></A><H3>LEFT</H3><PRE>public static final int <B>LEFT</B></PRE><DL><DD>Constant for positioning the anchor point of text and images to the left of the text or image. <P>Value <code>4</code> is assigned to <code>LEFT</code>.</P></DL><HR><A NAME="RIGHT"><!-- --></A><H3>RIGHT</H3><PRE>public static final int <B>RIGHT</B></PRE><DL><DD>Constant for positioning the anchor point of text and images to the right of the text or image. <P>Value <code>8</code> is assigned to <code>RIGHT</code>.</P></DL><HR><A NAME="TOP"><!-- --></A><H3>TOP</H3><PRE>public static final int <B>TOP</B></PRE><DL><DD>Constant for positioning the anchor point of text and images above the text or image. <P>Value <code>16</code> is assigned to <code>TOP</code>.</P></DL><HR><A NAME="BOTTOM"><!-- --></A><H3>BOTTOM</H3><PRE>public static final int <B>BOTTOM</B></PRE><DL><DD>Constant for positioning the anchor point of text and images below the text or image. <P>Value <code>32</code> is assigned to <code>BOTTOM</code>.</P></DL><HR><A NAME="BASELINE"><!-- --></A><H3>BASELINE</H3><PRE>public static final int <B>BASELINE</B></PRE><DL><DD>Constant for positioning the anchor point at the baseline of text. <P>Value <code>64</code> is assigned to <code>BASELINE</code>.</P></DL><HR><A NAME="SOLID"><!-- --></A><H3>SOLID</H3><PRE>public static final int <B>SOLID</B></PRE><DL><DD>Constant for the <code>SOLID</code> stroke style. <P>Value <code>0</code> is assigned to <code>SOLID</code>.</P></DL><HR><A NAME="DOTTED"><!-- --></A><H3>DOTTED</H3><PRE>public static final int <B>DOTTED</B></PRE><DL><DD>Constant for the <code>DOTTED</code> stroke style. <P>Value <code>1</code> is assigned to <code>DOTTED</code>.</P></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="translate(int, int)"><!-- --></A><H3>translate</H3><PRE>public void <B>translate</B>(int x, int y)</PRE><DL><DD>Translates the origin of the graphics context to the point <code>(x, y)</code> in the current coordinate system. All coordinates used in subsequent rendering operations on this graphics context will be relative to this new origin.<p> The effect of calls to <code>translate()</code> are cumulative. For example, calling <code>translate(1, 2)</code> and then <code>translate(3, 4)</code> results in a translation of <code>(4, 6)</code>. <p> The application can set an absolute origin <code>(ax, ay)</code> using the following technique:<p> <code> g.translate(ax - g.getTranslateX(), ay - g.getTranslateY()) </code><p><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the x coordinate of the new translation origin<DD><CODE>y</CODE> - the y coordinate of the new translation origin<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Graphics.html#getTranslateX()"><CODE>getTranslateX()</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Graphics.html#getTranslateY()"><CODE>getTranslateY()</CODE></A></DL></DD></DL><HR><A NAME="getTranslateX()"><!-- --></A><H3>getTranslateX</H3><PRE>public int <B>getTranslateX</B>()</PRE><DL><DD>Gets the X coordinate of the translated origin of this graphics context.<DD><DL><DT><B>Returns:</B><DD>X of current origin</DL></DD></DL><HR><A NAME="getTranslateY()"><!-- --></A><H3>getTranslateY</H3><PRE>public int <B>getTranslateY</B>()</PRE><DL><DD>Gets the Y coordinate of the translated origin of this graphics context.<DD><DL><DT><B>Returns:</B><DD>Y of current origin</DL></DD></DL><HR><A NAME="getColor()"><!-- --></A><H3>getColor</H3><PRE>public int <B>getColor</B>()</PRE><DL><DD>Gets the current color.<DD><DL><DT><B>Returns:</B><DD>an integer in form <code>0x00RRGGBB</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Graphics.html#setColor(int, int, int)"><CODE>setColor(int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="getRedComponent()"><!-- --></A><H3>getRedComponent</H3><PRE>public int <B>getRedComponent</B>()</PRE><DL><DD>Gets the red component of the current color.<DD><DL><DT><B>Returns:</B><DD>integer value in range <code>0-255</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Graphics.html#setColor(int, int, int)"><CODE>setColor(int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="getGreenComponent()"><!-- --></A><H3>getGreenComponent</H3><PRE>public int <B>getGreenComponent</B>()</PRE><DL><DD>Gets the green component of the current color.<DD><DL><DT><B>Returns:</B><DD>integer value in range <code>0-255</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Graphics.html#setColor(int, int, int)"><CODE>setColor(int, int, int)</CODE></A></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -