?? pngencoderb.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Sun Oct 19 10:04:44 PDT 2003 --><TITLE>PngEncoderB</TITLE><META NAME="keywords" CONTENT="com.keypoint.PngEncoderB,PngEncoderB class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><SCRIPT>function asd(){parent.document.title="PngEncoderB";}</SCRIPT><BODY BGCOLOR="white" onload="asd();"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <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="../../overview-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="../../com/keypoint/PngEncoder.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="PngEncoderB.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><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.keypoint</FONT><BR>Class PngEncoderB</H2><PRE>java.lang.Object | +--<A HREF="../../com/keypoint/PngEncoder.html">com.keypoint.PngEncoder</A> | +--<B>com.keypoint.PngEncoderB</B></PRE><HR><DL><DT>public class <B>PngEncoderB</B><DT>extends <A HREF="../../com/keypoint/PngEncoder.html">PngEncoder</A></DL><P>PngEncoderB takes a Java BufferedImage object and creates a byte string which can be saved as a PNG file. The encoder will accept BufferedImages with eight-bit samples or 4-byte ARGB samples. <p>There is also code to handle 4-byte samples returned as one int per pixel, but that has not been tested.</p> <p>Thanks to Jay Denny at KeyPoint Software <code>http://www.keypoint.com/</code> who let me develop this code on company time.</p> <p>You may contact me with (probably very-much-needed) improvements, comments, and bug fixes at:</p> <p><code>david@catcode.com</code></p> <p>This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.<p> <p>This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</p> <p>You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA A copy of the GNU LGPL may be found at <code>http://www.gnu.org/copyleft/lesser.html</code></p><P><P><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.awt.image.BufferedImage</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#image">image</A></B></CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#tType">tType</A></B></CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.awt.image.WritableRaster</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#wRaster">wRaster</A></B></CODE><BR> </TD></TR></TABLE> <A NAME="fields_inherited_from_class_com.keypoint.PngEncoder"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class com.keypoint.<A HREF="../../com/keypoint/PngEncoder.html">PngEncoder</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../com/keypoint/PngEncoder.html#bytePos">bytePos</A>, <A HREF="../../com/keypoint/PngEncoder.html#bytesPerPixel">bytesPerPixel</A>, <A HREF="../../com/keypoint/PngEncoder.html#compressionLevel">compressionLevel</A>, <A HREF="../../com/keypoint/PngEncoder.html#crc">crc</A>, <A HREF="../../com/keypoint/PngEncoder.html#crcValue">crcValue</A>, <A HREF="../../com/keypoint/PngEncoder.html#ENCODE_ALPHA">ENCODE_ALPHA</A>, <A HREF="../../com/keypoint/PngEncoder.html#encodeAlpha">encodeAlpha</A>, <A HREF="../../com/keypoint/PngEncoder.html#filter">filter</A>, <A HREF="../../com/keypoint/PngEncoder.html#FILTER_LAST">FILTER_LAST</A>, <A HREF="../../com/keypoint/PngEncoder.html#FILTER_NONE">FILTER_NONE</A>, <A HREF="../../com/keypoint/PngEncoder.html#FILTER_SUB">FILTER_SUB</A>, <A HREF="../../com/keypoint/PngEncoder.html#FILTER_UP">FILTER_UP</A>, <A HREF="../../com/keypoint/PngEncoder.html#height">height</A>, <A HREF="../../com/keypoint/PngEncoder.html#IDAT">IDAT</A>, <A HREF="../../com/keypoint/PngEncoder.html#IEND">IEND</A>, <A HREF="../../com/keypoint/PngEncoder.html#IHDR">IHDR</A>, <A HREF="../../com/keypoint/PngEncoder.html#leftBytes">leftBytes</A>, <A HREF="../../com/keypoint/PngEncoder.html#maxPos">maxPos</A>, <A HREF="../../com/keypoint/PngEncoder.html#NO_ALPHA">NO_ALPHA</A>, <A HREF="../../com/keypoint/PngEncoder.html#pngBytes">pngBytes</A>, <A HREF="../../com/keypoint/PngEncoder.html#priorRow">priorRow</A>, <A HREF="../../com/keypoint/PngEncoder.html#width">width</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#PngEncoderB()">PngEncoderB</A></B>()</CODE><BR> Class constructor</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><BR> Class constructor specifying BufferedImage to encode, with no alpha channel encoding.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#PngEncoderB(java.awt.image.BufferedImage, boolean)">PngEncoderB</A></B>(java.awt.image.BufferedImage image, boolean encodeAlpha)</CODE><BR> Class constructor specifying BufferedImage to encode, and whether to encode alpha.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#PngEncoderB(java.awt.image.BufferedImage, boolean, int)">PngEncoderB</A></B>(java.awt.image.BufferedImage image, boolean encodeAlpha, int whichFilter)</CODE><BR> Class constructor specifying BufferedImage to encode, whether to encode alpha, and filter to use.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#PngEncoderB(java.awt.image.BufferedImage, boolean, int, int)">PngEncoderB</A></B>(java.awt.image.BufferedImage image, boolean encodeAlpha, int whichFilter, int compLevel)</CODE><BR> Class constructor specifying BufferedImage source to encode, whether to encode alpha, filter to use, and compression level</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#establishStorageInfo()">establishStorageInfo</A></B>()</CODE><BR> Get and set variables that determine how picture is stored.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#pngEncode()">pngEncode</A></B>()</CODE><BR> Creates an array of bytes that is the PNG equivalent of the current image.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#pngEncode(boolean)">pngEncode</A></B>(boolean encodeAlpha)</CODE><BR> Creates an array of bytes that is the PNG equivalent of the current image, specifying whether to encode alpha or not.</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="../../com/keypoint/PngEncoderB.html#setImage(java.awt.image.BufferedImage)">setImage</A></B>(java.awt.image.BufferedImage image)</CODE><BR> Set the BufferedImage to be encoded</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#writeHeader()">writeHeader</A></B>()</CODE><BR> Write a PNG "IHDR" chunk into the pngBytes array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#writeImageData()">writeImageData</A></B>()</CODE><BR> Write the image data into the pngBytes array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../com/keypoint/PngEncoderB.html#writePalette(java.awt.image.IndexColorModel)">writePalette</A></B>(java.awt.image.IndexColorModel icm)</CODE><BR> </TD></TR></TABLE> <A NAME="methods_inherited_from_class_com.keypoint.PngEncoder"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class com.keypoint.<A HREF="../../com/keypoint/PngEncoder.html">PngEncoder</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../com/keypoint/PngEncoder.html#filterSub(byte[], int, int)">filterSub</A>, <A HREF="../../com/keypoint/PngEncoder.html#filterUp(byte[], int, int)">filterUp</A>, <A HREF="../../com/keypoint/PngEncoder.html#getCompressionLevel()">getCompressionLevel</A>, <A HREF="../../com/keypoint/PngEncoder.html#getEncodeAlpha()">getEncodeAlpha</A>, <A HREF="../../com/keypoint/PngEncoder.html#getFilter()">getFilter</A>, <A HREF="../../com/keypoint/PngEncoder.html#resizeByteArray(byte[], int)">resizeByteArray</A>, <A HREF="../../com/keypoint/PngEncoder.html#setCompressionLevel(int)">setCompressionLevel</A>, <A HREF="../../com/keypoint/PngEncoder.html#setEncodeAlpha(boolean)">setEncodeAlpha</A>, <A HREF="../../com/keypoint/PngEncoder.html#setFilter(int)">setFilter</A>, <A HREF="../../com/keypoint/PngEncoder.html#setImage(java.awt.Image)">setImage</A>, <A HREF="../../com/keypoint/PngEncoder.html#writeByte(int, int)">writeByte</A>, <A HREF="../../com/keypoint/PngEncoder.html#writeBytes(byte[], int)">writeBytes</A>, <A HREF="../../com/keypoint/PngEncoder.html#writeBytes(byte[], int, int)">writeBytes</A>, <A HREF="../../com/keypoint/PngEncoder.html#writeEnd()">writeEnd</A>, <A HREF="../../com/keypoint/PngEncoder.html#writeInt2(int, int)">writeInt2</A>, <A HREF="../../com/keypoint/PngEncoder.html#writeInt4(int, int)">writeInt4</A></CODE></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">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -