⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<A NAME="createImage(java.io.InputStream)"><!-- --></A><H3>
createImage</H3>
<PRE>
public static <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A> <B>createImage</B>(<A HREF="../../../java/io/InputStream.html">InputStream</A>&nbsp;stream)                         throws <A HREF="../../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Creates an immutable image from decoded image data obtained from an <code>InputStream</code>.  This method blocks until all image data has  been read and decoded.  After this method completes (whether by  returning or by throwing an exception) the stream is left open and its  current position is undefined.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>stream</CODE> - the name of the resource containing the image data in one of the supported image formats<DT><B>Returns:</B><DD>the created image<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>stream</code> is <code>null</code><DD><CODE><A HREF="../../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs, if the image data cannot be loaded, or if the image data cannot be decoded<DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="createRGBImage(int[], int, int, boolean)"><!-- --></A><H3>
createRGBImage</H3>
<PRE>
public static <A HREF="../../../javax/microedition/lcdui/Image.html">Image</A> <B>createRGBImage</B>(int[]&nbsp;rgb,                                   int&nbsp;width,                                   int&nbsp;height,                                   boolean&nbsp;processAlpha)</PRE>
<DL>
<DD>Creates an immutable image from a sequence of ARGB values, specified as <code>0xAARRGGBB</code>. The ARGB data within the <code>rgb</code> array is arranged horizontally from left to right within each row, row by row from top to bottom. If <code>processAlpha</code> is <code>true</code>, the high-order byte specifies opacity; that is, <code>0x00RRGGBB</code> specifies a fully transparent pixel and <code>0xFFRRGGBB</code> specifies a fully opaque pixel.  Intermediate alpha values specify semitransparency.  If the implementation does not support alpha blending for image rendering operations, it must replace any semitransparent pixels with fully transparent pixels.  (See <a href="#alpha">Alpha Processing</a> for further discussion.)  If <code>processAlpha</code> is <code>false</code>, the alpha values are ignored and all pixels must be treated as fully opaque. <p>Consider <code>P(a,b)</code> to be the value of the pixel located at column <code>a</code> and row <code>b</code> of the Image, where rows and columns are numbered downward from the top starting at zero, and columns are numbered rightward from the left starting at zero. This operation can then be defined as:</p> <TABLE BORDER="2"> <TR> <TD ROWSPAN="1" COLSPAN="1">    <pre><code>    P(a, b) = rgb[a + b * width];    </code></pre> </TD> </TR> </TABLE> <p>for</p> <TABLE BORDER="2"> <TR> <TD ROWSPAN="1" COLSPAN="1">    <pre><code>     0 &lt;= a &lt; width     0 &lt;= b &lt; height    </code></pre> </TD> </TR> </TABLE> <p> </p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>rgb</CODE> - an array of ARGB values that composes the image<DD><CODE>width</CODE> - the width of the image<DD><CODE>height</CODE> - the height of the image<DD><CODE>processAlpha</CODE> - <code>true</code> if <code>rgb</code> has an alpha channel, <code>false</code> if all pixels are fully opaque<DT><B>Returns:</B><DD>the created image<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>rgb</code> is <code>null</code>.<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if either <code>width</code> or <code>height</code> is zero or less<DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the length of <code>rgb</code> is less than<code> width&nbsp;*&nbsp;height</code>.<DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="getRGB(int[], int, int, int, int, int, int)"><!-- --></A><H3>
getRGB</H3>
<PRE>
public void <B>getRGB</B>(int[]&nbsp;rgbData,                   int&nbsp;offset,                   int&nbsp;scanlength,                   int&nbsp;x,                   int&nbsp;y,                   int&nbsp;width,                   int&nbsp;height)</PRE>
<DL>
<DD>Obtains ARGB pixel data from the specified region of this image and stores it in the provided array of integers.  Each pixel value is stored in <code>0xAARRGGBB</code> format, where the high-order byte contains the alpha channel and the remaining bytes contain color components for red, green and blue, respectively.  The alpha channel specifies the opacity of the pixel, where a value of <code>0x00</code> represents a pixel that is fully transparent and a value of <code>0xFF</code> represents a fully opaque pixel. <p> The returned values are not guaranteed to be identical to values from the original source, such as from <code>createRGBImage</code> or from a PNG image.  Color values may be resampled to reflect the display capabilities of the device (for example, red, green or blue pixels may all be represented by the same gray value on a grayscale device).  On devices that do not support alpha blending, the alpha value will be <code>0xFF</code> for opaque pixels and <code>0x00</code> for all other pixels (see <a href="#alpha">Alpha Processing</a> for further discussion.)  On devices that support alpha blending, alpha channel values may be resampled to reflect the number of levels of semitransparency supported.</p> <p>The <code>scanlength</code> specifies the relative offset within the array between the corresponding pixels of consecutive rows.  In order to prevent rows of stored pixels from overlapping, the absolute value of <code>scanlength</code> must be greater than or equal to <code>width</code>.  Negative values of <code>scanlength</code> are allowed.  In all cases, this must result in every reference being within the bounds of the <code>rgbData</code> array.</p> <p>Consider <code>P(a,b)</code> to be the value of the pixel located at column <code>a</code> and row <code>b</code> of the Image, where rows and columns are numbered downward from the top starting at zero, and columns are numbered rightward from the left starting at zero. This operation can then be defined as:</p> <TABLE BORDER="2"> <TR> <TD ROWSPAN="1" COLSPAN="1">    <pre><code>    rgbData[offset + (a - x) + (b - y) * scanlength] = P(a, b);</code></pre> </TD> </TR> </TABLE> <p>for</p> <TABLE BORDER="2"> <TR> <TD ROWSPAN="1" COLSPAN="1">    <pre><code>     x &lt;= a &lt; x + width     y &lt;= b &lt; y + height    </code></pre> </TD> </TR> </TABLE> <p>The source rectangle is required to not exceed the bounds of the image.  This means: </p> <TABLE BORDER="2"> <TR> <TD ROWSPAN="1" COLSPAN="1">    <pre><code>   x &gt;= 0   y &gt;= 0   x + width &lt;= image width   y + height &lt;= image height    </code></pre> </TD> </TR> </TABLE> <p> If any of these conditions is not met an <code>IllegalArgumentException</code> is thrown.  Otherwise, in cases where <code>width &lt;= 0</code> or <code>height &lt;= 0</code>, no exception is thrown, and no pixel data is copied to <code>rgbData</code>.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>rgbData</CODE> - an array of integers in which the ARGB pixel data is stored<DD><CODE>offset</CODE> - the index into the array where the first ARGB value is stored<DD><CODE>scanlength</CODE> - the relative offset in the array between corresponding pixels in consecutive rows of the region<DD><CODE>x</CODE> - the x-coordinate of the upper left corner of the region<DD><CODE>y</CODE> - the y-coordinate of the upper left corner of the region<DD><CODE>width</CODE> - the width of the region<DD><CODE>height</CODE> - the height of the region<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if the requested operation would attempt to access an element in the <code>rgbData</code> array whose index is either negative or beyond its length (the contents of the array are unchanged)<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the area being retrieved exceeds the bounds of the source image<DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the absolute value of <code>scanlength</code> is less than <code>width</code><DD><CODE><A HREF="../../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - if <code>rgbData</code> is <code>null</code><DT><B>Since: </B><DD>MIDP 2.0</DD>
</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=2 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>&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/Image.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-all.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>
<strong>MID Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/lcdui/Graphics.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/lcdui/ImageItem.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>  &nbsp;
&nbsp;<A HREF="Image.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&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>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>

⌨️ 快捷键说明

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