📄 background.html
字号:
</DD>
</DL>
<HR>
<A NAME="getColor()"><!-- --></A><H3>
getColor</H3>
<PRE>
public int <B>getColor</B>()</PRE>
<DL>
<DD><p>Retrieves the current background color.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current background color in 0xAARRGGBB format<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setColor(int)"><CODE>setColor</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setImage(javax.microedition.m3g.Image2D)"><!-- --></A><H3>
setImage</H3>
<PRE>
public void <B>setImage</B>(<A HREF="../../../javax/microedition/m3g/Image2D.html">Image2D</A> image)</PRE>
<DL>
<DD><p>Sets the background image, or switches from background image mode to background color mode. The background image must be in the same format as the rendering target: RGB or RGBA in case of an Image2D target and RGB in case of a MIDP Graphics target.</p> <p>The crop rectangle is set such that its top left corner is at the top left corner of the image, and its width and height are equal to the dimensions of the image.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>image</CODE> - the background image, or null to disable the current background image (if any) and clear with the background color only<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>image</code> is not in RGB or RGBA format<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#getImage()"><CODE>getImage</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getImage()"><!-- --></A><H3>
getImage</H3>
<PRE>
public <A HREF="../../../javax/microedition/m3g/Image2D.html">Image2D</A> <B>getImage</B>()</PRE>
<DL>
<DD><p>Gets the current background image.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the current background image<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setImage(javax.microedition.m3g.Image2D)"><CODE>setImage</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setImageMode(int, int)"><!-- --></A><H3>
setImageMode</H3>
<PRE>
public void <B>setImageMode</B>(int modeX, int modeY)</PRE>
<DL>
<DD><p>Sets the background image repeat mode for the X and Y directions.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>modeX</CODE> - X repeat mode; one of <code>BORDER, REPEAT</code><DD><CODE>modeY</CODE> - Y repeat mode; one of <code>BORDER, REPEAT</code><DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>modeX</code> or <code>modeY</code> is not one of the enumerated values listed above</DL>
</DD>
</DL>
<HR>
<A NAME="getImageModeX()"><!-- --></A><H3>
getImageModeX</H3>
<PRE>
public int <B>getImageModeX</B>()</PRE>
<DL>
<DD><p>Gets the current background image repeat mode for the X dimension.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the X repeat mode<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setImageMode(int, int)"><CODE>setImageMode</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getImageModeY()"><!-- --></A><H3>
getImageModeY</H3>
<PRE>
public int <B>getImageModeY</B>()</PRE>
<DL>
<DD><p>Gets the current background image repeat mode for the Y dimension.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the Y repeat mode<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setImageMode(int, int)"><CODE>setImageMode</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setCrop(int, int, int, int)"><!-- --></A><H3>
setCrop</H3>
<PRE>
public void <B>setCrop</B>(int cropX, int cropY, int width, int height)</PRE>
<DL>
<DD><p>Sets a cropping rectangle within the background image. The contents of the crop rectangle are scaled (stretched or condensed) to fill the viewport entirely.</p> <p>The position of the upper left corner of the crop rectangle is given in pixels, relative to the upper left corner of the Image2D. Note that the relative position may be negative in either or both axes.</p> <p>If the crop rectangle lies completely or partially outside of the source image boundaries, the values of the (imaginary) pixels outside of the image are defined by the repeat mode. In <code>BORDER</code> mode, the imaginary pixels are taken to have the background color. In <code>REPEAT</code> mode, the source image is considered to repeat indefinitely.</p> <p>The repeat mode can be specified independently for the X and Y directions.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cropX</CODE> - the X position of the top left of the crop rectangle, in pixels<DD><CODE>cropY</CODE> - the Y position of the top left of the crop rectangle, in pixels<DD><CODE>width</CODE> - the width of the crop rectangle, in pixels<DD><CODE>height</CODE> - the height of the crop rectangle, in pixels<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>width < 0</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>height < 0</code></DL>
</DD>
</DL>
<HR>
<A NAME="getCropX()"><!-- --></A><H3>
getCropX</H3>
<PRE>
public int <B>getCropX</B>()</PRE>
<DL>
<DD><p>Retrieves the current cropping rectangle X offset relative to the source image top left corner.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the X offset of the cropping rectangle<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setCrop(int, int, int, int)"><CODE>setCrop</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getCropY()"><!-- --></A><H3>
getCropY</H3>
<PRE>
public int <B>getCropY</B>()</PRE>
<DL>
<DD><p>Retrieves the current cropping rectangle Y offset relative to the source image top left corner.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the X offset of the cropping rectangle<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setCrop(int, int, int, int)"><CODE>setCrop</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getCropWidth()"><!-- --></A><H3>
getCropWidth</H3>
<PRE>
public int <B>getCropWidth</B>()</PRE>
<DL>
<DD><p>Gets the current cropping rectangle width within the source image.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the width of the cropping rectangle<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setCrop(int, int, int, int)"><CODE>setCrop</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getCropHeight()"><!-- --></A><H3>
getCropHeight</H3>
<PRE>
public int <B>getCropHeight</B>()</PRE>
<DL>
<DD><p>Gets the current cropping rectangle height within the source image.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the height of the cropping rectangle<DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Background.html#setCrop(int, int, int, int)"><CODE>setCrop</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="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="class-use/Background.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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-files/index-1.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><B>Nov 19, 2003</B></EM></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/m3g/Appearance.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/m3g/Camera.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Background.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<EM>Copyright © 2003 Nokia Corporation. See the <a href="../../../overview-summary.html#Copyright">Copyright Notice</a> for details.</EM>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -