📄 background.html
字号:
<A NAME="ALLOW_IMAGE_SCALE_MODE_WRITE"><!-- --></A><H3>ALLOW_IMAGE_SCALE_MODE_WRITE</H3><PRE>public static final int <B>ALLOW_IMAGE_SCALE_MODE_WRITE</B></PRE><DL><DD>Specifies that the Background allows write access to its image scale mode at runtime.<P><DL><DT><B>Since:</B><DD>Java 3D 1.3</DD></DD><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.media.j3d.Background.ALLOW_IMAGE_SCALE_MODE_WRITE">Constant Field Values</A></DL></DL><HR><A NAME="SCALE_NONE"><!-- --></A><H3>SCALE_NONE</H3><PRE>public static final int <B>SCALE_NONE</B></PRE><DL><DD>Indicates that no scaling of the background image is done. The image will be drawn in its actual size. If the window is smaller than the image, the image will be clipped. If the window is larger than the image, the portion of the window not filled by the image will be filled with the background color. In all cases, the upper left corner of the image is anchored at the upper-left corner of the window. This is the default mode.<P><DL><DT><B>Since:</B><DD>Java 3D 1.3</DD></DD><DT><B>See Also:</B><DD><A HREF="../../../javax/media/j3d/Background.html#setImageScaleMode(int)"><CODE>setImageScaleMode(int)</CODE></A>, <A HREF="../../../constant-values.html#javax.media.j3d.Background.SCALE_NONE">Constant Field Values</A></DL></DL><HR><A NAME="SCALE_FIT_MIN"><!-- --></A><H3>SCALE_FIT_MIN</H3><PRE>public static final int <B>SCALE_FIT_MIN</B></PRE><DL><DD>Indicates that the background image is uniformly scaled to fit the window such that the entire image is visible. The image is scaled by the smaller of <code>window.width/image.width</code> and <code>window.height/image.height</code>. The image will exactly fill either the width or height of the window, but not necessarily both. The portion of the window not filled by the image will be filled with the background color. The upper left corner of the image is anchored at the upper-left corner of the window.<P><DL><DT><B>Since:</B><DD>Java 3D 1.3</DD></DD><DT><B>See Also:</B><DD><A HREF="../../../javax/media/j3d/Background.html#setImageScaleMode(int)"><CODE>setImageScaleMode(int)</CODE></A>, <A HREF="../../../constant-values.html#javax.media.j3d.Background.SCALE_FIT_MIN">Constant Field Values</A></DL></DL><HR><A NAME="SCALE_FIT_MAX"><!-- --></A><H3>SCALE_FIT_MAX</H3><PRE>public static final int <B>SCALE_FIT_MAX</B></PRE><DL><DD>Indicates that the background image is uniformly scaled to fit the window such that the entire window is filled. The image is scaled by the larger of <code>window.width/image.width</code> and <code>window.height/image.height</code>. The image will entirely fill the window, but may by clipped either in <i>X</i> or <i>Y</i>. The upper left corner of the image is anchored at the upper-left corner of the window.<P><DL><DT><B>Since:</B><DD>Java 3D 1.3</DD></DD><DT><B>See Also:</B><DD><A HREF="../../../javax/media/j3d/Background.html#setImageScaleMode(int)"><CODE>setImageScaleMode(int)</CODE></A>, <A HREF="../../../constant-values.html#javax.media.j3d.Background.SCALE_FIT_MAX">Constant Field Values</A></DL></DL><HR><A NAME="SCALE_FIT_ALL"><!-- --></A><H3>SCALE_FIT_ALL</H3><PRE>public static final int <B>SCALE_FIT_ALL</B></PRE><DL><DD>Indicates that the background image is scaled to fit the window. The image is scaled non-uniformly in <i>x</i> and <i>y</i> by <code>window.width/image.width</code> and and <code>window.height/image.height</code>, respectively. The image will entirely fill the window.<P><DL><DT><B>Since:</B><DD>Java 3D 1.3</DD></DD><DT><B>See Also:</B><DD><A HREF="../../../javax/media/j3d/Background.html#setImageScaleMode(int)"><CODE>setImageScaleMode(int)</CODE></A>, <A HREF="../../../constant-values.html#javax.media.j3d.Background.SCALE_FIT_ALL">Constant Field Values</A></DL></DL><HR><A NAME="SCALE_REPEAT"><!-- --></A><H3>SCALE_REPEAT</H3><PRE>public static final int <B>SCALE_REPEAT</B></PRE><DL><DD>Indicates that the background image is tiled to fill the entire window. The image is not scaled. The upper left corner of the image is anchored at the upper-left corner of the window.<P><DL><DT><B>Since:</B><DD>Java 3D 1.3</DD></DD><DT><B>See Also:</B><DD><A HREF="../../../javax/media/j3d/Background.html#setImageScaleMode(int)"><CODE>setImageScaleMode(int)</CODE></A>, <A HREF="../../../constant-values.html#javax.media.j3d.Background.SCALE_REPEAT">Constant Field Values</A></DL></DL><HR><A NAME="SCALE_NONE_CENTER"><!-- --></A><H3>SCALE_NONE_CENTER</H3><PRE>public static final int <B>SCALE_NONE_CENTER</B></PRE><DL><DD>Indicates that the background image is centered in the window and that no scaling of the image is done. The image will be drawn in its actual size. If the window is smaller than the image, the image will be clipped. If the window is larger than the image, the portion of the window not filled by the image will be filled with the background color.<P><DL><DT><B>Since:</B><DD>Java 3D 1.3</DD></DD><DT><B>See Also:</B><DD><A HREF="../../../javax/media/j3d/Background.html#setImageScaleMode(int)"><CODE>setImageScaleMode(int)</CODE></A>, <A HREF="../../../constant-values.html#javax.media.j3d.Background.SCALE_NONE_CENTER">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Background()"><!-- --></A><H3>Background</H3><PRE>public <B>Background</B>()</PRE><DL><DD>Constructs a Background node with default parameters. The default values are as follows: <ul> color : black (0,0,0)<br> image : null<br> geometry : null<br> image scale mode : SCALE_NONE<br> application bounds : null<br> application bounding leaf : null<br> </ul><P></DL><HR><A NAME="Background(javax.vecmath.Color3f)"><!-- --></A><H3>Background</H3><PRE>public <B>Background</B>(<A HREF="../../../javax/vecmath/Color3f.html">Color3f</A> color)</PRE><DL><DD>Constructs a Background node with the specified color. This color is used to fill the window prior to drawing any objects in the scene.<P></DL><HR><A NAME="Background(float, float, float)"><!-- --></A><H3>Background</H3><PRE>public <B>Background</B>(float r, float g, float b)</PRE><DL><DD>Constructs a Background node with the specified color. This color is used to fill the window prior to drawing any objects in the scene.<P></DL><HR><A NAME="Background(javax.media.j3d.ImageComponent2D)"><!-- --></A><H3>Background</H3><PRE>public <B>Background</B>(<A HREF="../../../javax/media/j3d/ImageComponent2D.html">ImageComponent2D</A> image)</PRE><DL><DD>Constructs a Background node with the specified image. If this image is non-null, it is rendered to the window prior to drawing any objects in the scene. If the image is smaller than the window, then that portion of the window not covered by the image is filled with the background color.<P><DT><B>Parameters:</B><DD><CODE>image</CODE> - pixel array object used as the background image</DL><HR><A NAME="Background(javax.media.j3d.BranchGroup)"><!-- --></A><H3>Background</H3><PRE>public <B>Background</B>(<A HREF="../../../javax/media/j3d/BranchGroup.html">BranchGroup</A> branch)</PRE><DL><DD>Constructs a Background node with the specified geometry. If non-null, this background geometry is drawn on top of the background color and image using a projection matrix that essentially puts the geometry at infinity. The geometry should be pre-tessellated onto a unit sphere.<P><DT><B>Parameters:</B><DD><CODE>branch</CODE> - the root of the background geometry<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/media/j3d/IllegalSharingException.html">IllegalSharingException</A></CODE> - if the BranchGroup node is a child of any Group node, or is already attached to a Locale, or is already referenced by another Background node.<DD><CODE><A HREF="../../../javax/media/j3d/IllegalSceneGraphException.html">IllegalSceneGraphException</A></CODE> - if specified branch graph contains an illegal node.</DL><!-- ============ 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="setColor(javax.vecmath.Color3f)"><!-- --></A><H3>setColor</H3><PRE>public void <B>setColor</B>(<A HREF="../../../javax/vecmath/Color3f.html">Color3f</A> color)</PRE><DL><DD>Sets the background color to the specified color. This color is used to fill the window prior to drawing any objects in the scene.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>color</CODE> - the new background color<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/media/j3d/CapabilityNotSetException.html">CapabilityNotSetException</A></CODE> - if appropriate capability is not set and this object is part of live or compiled scene graph</DL></DD></DL><HR><A NAME="setColor(float, float, float)"><!-- --></A><H3>setColor</H3><PRE>public void <B>setColor</B>(float r, float g, float b)</PRE><DL><DD>Sets the background color to the specified color. This color is used to fill the window prior to drawing any objects in the scene.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>r</CODE> - the red component of the background color<DD><CODE>g</CODE> - the green component of the background color<DD><CODE>b</CODE> - the blue component of the background color<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/media/j3d/CapabilityNotSetException.html">CapabilityNotSetException</A></CODE> - if appropriate capability is not set and this object is part of live or compiled scene graph</DL></DD></DL><HR><A NAME="getColor(javax.vecmath.Color3f)"><!-- --></A><H3>getColor</H3><PRE>public void <B>getColor</B>(<A HREF="../../../javax/vecmath/Color3f.html">Color3f</A> color)</PRE><DL><DD>Retrieves the background color.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>color</CODE> - the vector that will receive the current background color<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/media/j3d/CapabilityNotSetException.html">CapabilityNotSetException</A></CODE> - if appropriate capability is not set and this object is part of live or compiled scene graph</DL></DD></DL><HR><A NAME="setImage(javax.media.j3d.ImageComponent2D)"><!-- --></A><H3>setImage</H3><PRE>public void <B>setImage</B>(<A HREF="../../../javax/media/j3d/ImageComponent2D.html">ImageComponent2D</A> image)</PRE><DL><DD>Sets the background image to the specified image. If this image is non-null, it is rendered to the window prior to drawing any objects in the scene. If the image is smaller than the window, then that portion of the window not covered by the image is filled with the background color.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>image</CODE> - new pixel array object used as the background image<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/media/j3d/CapabilityNotSetException.html">CapabilityNotSetException</A></CODE> - if appropriate capability is not set and this object is part of live or compiled scene graph</DL></DD></DL><HR><A NAME="getImage()"><!-- --></A><H3>getImage</H3><PRE>public <A HREF="../../../javax/media/j3d/ImageComponent2D.html">ImageComponent2D</A> <B>getImage</B>()</PRE><DL><DD>Retrieves the background image.<P><DD><DL><DT><B>Returns:</B><DD>the current background image<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/media/j3d/CapabilityNotSetException.html">CapabilityNotSetException</A></CODE> - if appropriate capability is not set and this object is part of live or compiled scene graph</DL></DD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -