graphics.html
来自「维信SDK文档。源码要求为至少5个C或Java源码」· HTML 代码 · 共 557 行 · 第 1/2 页
HTML
557 行
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getColor()"><!-- --></A><H3>getColor</H3><PRE> int <B>getColor</B>()</PRE><DL><DD>Gets the current color.<P><DD><DL><DT><B>Returns:</B><DD>an integer in form <code>0x00RRGGBB</code><DT><B>See Also:</B><DD><A HREF="../../widsets/api/Graphics.html#setColor(int)"><CODE>setColor(int)</CODE></A></DL></DD></DL><HR><A NAME="setColor(int)"><!-- --></A><H3>setColor</H3><PRE> void <B>setColor</B>(int color)</PRE><DL><DD>Sets the current color to the specified RGB values. All subsequent rendering operations will use this specified color. The RGB value passed in is interpreted with the least significant eight bits giving the blue component, the next eight more significant bits giving the green component, and the next eight more significant bits giving the red component. That is to say, the color component is specified in the form of <code>0x00RRGGBB</code>. The high order byte of this value is ignored.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>color</CODE> - the color being set<DT><B>See Also:</B><DD><A HREF="../../widsets/api/Graphics.html#getColor()"><CODE>getColor()</CODE></A></DL></DD></DL><HR><A NAME="getFont()"><!-- --></A><H3>getFont</H3><PRE> <A HREF="../../widsets/api/Font.html" title="class in ">Font</A> <B>getFont</B>()</PRE><DL><DD>Gets the current font used by text drawing operations.<P><DD><DL><DT><B>Returns:</B><DD>current font<DT><B>See Also:</B><DD><A HREF="../../widsets/api/Graphics.html#setFont(Font)"><CODE>setFont(Font)</CODE></A></DL></DD></DL><HR><A NAME="setFont(Font)"><!-- --></A><H3>setFont</H3><PRE> void <B>setFont</B>(<A HREF="../../widsets/api/Font.html" title="class in ">Font</A> font)</PRE><DL><DD>Sets the font for all subsequent text rendering operations.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>font</CODE> - the specified font<DT><B>See Also:</B><DD><A HREF="../../widsets/api/Graphics.html#getFont()"><CODE>getFont()</CODE></A>, <A HREF="../../widsets/api/Graphics.html#drawString(String, int, int, int)"><CODE>drawString(String, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="drawLine(int, int, int, int)"><!-- --></A><H3>drawLine</H3><PRE> void <B>drawLine</B>(int x1, int y1, int x2, int y2)</PRE><DL><DD>Draws a line between the coordinates <code>(x1,y1)</code> and <code>(x2,y2)</code> using the current color and stroke style.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>x1</CODE> - the x coordinate of the start of the line<DD><CODE>y1</CODE> - the y coordinate of the start of the line<DD><CODE>x2</CODE> - the x coordinate of the end of the line<DD><CODE>y2</CODE> - the y coordinate of the end of the line</DL></DD></DL><HR><A NAME="drawRect(int, int, int, int)"><!-- --></A><H3>drawRect</H3><PRE> void <B>drawRect</B>(int x, int y, int width, int height)</PRE><DL><DD>Draws the outline of the specified rectangle using the current color and stroke style. The resulting rectangle will cover an area <code>(width + 1)</code> pixels wide by <code>(height + 1)</code> pixels tall. If either width or height is less than zero, nothing is drawn.<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<DT><B>See Also:</B><DD><A HREF="../../widsets/api/Graphics.html#fillRect(int, int, int, int)"><CODE>fillRect(int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="fillRect(int, int, int, int)"><!-- --></A><H3>fillRect</H3><PRE> void <B>fillRect</B>(int x, int y, int width, int height)</PRE><DL><DD>Fills the specified rectangle with the current color. If either width or height is zero or less, nothing is drawn.<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<DT><B>See Also:</B><DD><A HREF="../../widsets/api/Graphics.html#drawRect(int, int, int, int)"><CODE>drawRect(int, int, int, int)</CODE></A></DL></DD></DL><HR><A NAME="fillTriangle(int, int, int, int, int, int)"><!-- --></A><H3>fillTriangle</H3><PRE> void <B>fillTriangle</B>(int x1, int y1, int x2, int y2, int x3, int y3)</PRE><DL><DD>Fills the specified triangle will the current color. The lines connecting each pair of points are included in the filled triangle.<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="drawImage(Image, int, int, int)"><!-- --></A><H3>drawImage</H3><PRE> void <B>drawImage</B>(<A HREF="../../widsets/api/Image.html" title="class in ">Image</A> img, int x, int y, int anchor)</PRE><DL><DD>Draws the specified image by using the anchor point. The image can be drawn in different positions relative to the anchor point by passing the appropriate position constants.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>img</CODE> - the specified image to be drawn<DD><CODE>x</CODE> - the x coordinate of the anchor point<DD><CODE>y</CODE> - the y coordinate of the anchor point<DD><CODE>anchor</CODE> - the anchor point for positioning the image</DL></DD></DL><HR><A NAME="drawString(String, int, int, int)"><!-- --></A><H3>drawString</H3><PRE> void <B>drawString</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A> str, int x, int y, int anchor)</PRE><DL><DD>Draws the specified <code>String</code> using the current font and color. The <code>x,y</code> position is the position of the anchor point.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - the <code>String</code> to be drawn<DD><CODE>x</CODE> - the x coordinate of the anchor point<DD><CODE>y</CODE> - the y coordinate of the anchor point<DD><CODE>anchor</CODE> - the anchor point for positioning the text</DL></DD></DL><HR><A NAME="fillArc(int, int, int, int, int, int)"><!-- --></A><H3>fillArc</H3><PRE> void <B>fillArc</B>(int x, int y, int width, int height, int startAngle, int arcAngle)</PRE><DL><DD>Fills a circular or elliptical arc covering the specified rectangle.<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 [0..360].<DD><CODE>arcAngle</CODE> - the angular extent of the arc, relative to the start angle [0..360].</DL></DD></DL><HR><A NAME="drawArc(int, int, int, int, int, int)"><!-- --></A><H3>drawArc</H3><PRE> void <B>drawArc</B>(int x, int y, int width, int height, int startAngle, int arcAngle)</PRE><DL><DD>Draws a circular or elliptical arc covering the specified rectangle.<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 [0..360].<DD><CODE>arcAngle</CODE> - the angular extent of the arc, relative to the start angle [0..360].</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="../../widsets/api/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../widsets/api/Font.html" title="class in "><B>PREV CLASS</B></A> <A HREF="../../widsets/api/HyperText.html" title="class in "><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?widsets/api/Graphics.html" target="_top"><B>FRAMES</B></A> <A HREF="Graphics.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?