亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pngencoder.java

?? JfreeChart 常用圖表例子
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.keypoint;import java.awt.Image;import java.awt.image.ImageObserver;import java.awt.image.PixelGrabber;import java.io.ByteArrayOutputStream;import java.io.IOException;import java.util.zip.CRC32;import java.util.zip.Deflater;import java.util.zip.DeflaterOutputStream;/** * PngEncoder takes a Java Image object and creates a byte string which can be saved as a PNG file. * The Image is presumed to use the DirectColorModel. * * Thanks to Jay Denny at KeyPoint Software *    http://www.keypoint.com/ * who let me develop this code on company time. * * You may contact me with (probably very-much-needed) improvements, * comments, and bug fixes at: * *   david@catcode.com * * 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. * * 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. * * 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 * http://www.gnu.org/copyleft/lesser.html, * * @author J. David Eisenberg * @version 1.4, 31 March 2000 * * CHANGES: * -------- * 19-Nov-2002 : CODING STYLE CHANGES ONLY (by David Gilbert for Object Refinery Limited); * 19-Sep-2003 : Fix for platforms using EBCDIC (contributed by Paulo Soares); * */public class PngEncoder extends Object {    /** Constant specifying that alpha channel should be encoded. */    public static final boolean ENCODE_ALPHA = true;    /** Constant specifying that alpha channel should not be encoded. */    public static final boolean NO_ALPHA = false;    /** Constants for filter (NONE). */    public static final int FILTER_NONE = 0;    /** Constants for filter (SUB). */    public static final int FILTER_SUB = 1;    /** Constants for filter (UP). */    public static final int FILTER_UP = 2;    /** Constants for filter (LAST). */    public static final int FILTER_LAST = 2;        /** IHDR tag. */    private static final byte[] IHDR = {73, 72, 68, 82};        /** IDAT tag. */    private static final byte[] IDAT = {73, 68, 65, 84};        /** IEND tag. */    private static final byte[] IEND = {73, 69, 78, 68};    /** The png bytes. */    private byte[] pngBytes;    /** The prior row. */    private byte[] priorRow;    /** The left bytes. */    private byte[] leftBytes;    /** The image. */    private Image image;    /** The width. */    private int width;    /** The height. */    private int height;    /** The byte position. */    private int bytePos;    /** The maximum position. */    private int maxPos;    /** CRC. */    private CRC32 crc = new CRC32();    /** The CRC value. */    private long crcValue;    /** Encode alpha flag. */    private boolean encodeAlpha;    /** The filter type. */    private int filter;    /** The bytes-per-pixel. */    private int bytesPerPixel;    /** The compression level (1 = best speed, 9 = best compression, 0 = no compression). */    private int compressionLevel;    /**     * Class constructor.     */    public PngEncoder() {        this(null, false, FILTER_NONE, 0);    }    /**     * Class constructor specifying Image to encode, with no alpha channel encoding.     *     * @param image A Java Image object which uses the DirectColorModel     * @see java.awt.Image     */    public PngEncoder(Image image) {        this(image, false, FILTER_NONE, 0);    }    /**     * Class constructor specifying Image to encode, and whether to encode alpha.     *     * @param image A Java Image object which uses the DirectColorModel     * @param encodeAlpha Encode the alpha channel? false=no; true=yes     * @see java.awt.Image     */    public PngEncoder(Image image, boolean encodeAlpha) {        this(image, encodeAlpha, FILTER_NONE, 0);    }    /**     * Class constructor specifying Image to encode, whether to encode alpha, and filter to use.     *     * @param image A Java Image object which uses the DirectColorModel     * @param encodeAlpha Encode the alpha channel? false=no; true=yes     * @param whichFilter 0=none, 1=sub, 2=up     * @see java.awt.Image     */    public PngEncoder(Image image, boolean encodeAlpha, int whichFilter) {        this(image, encodeAlpha, whichFilter, 0);    }    /**     * Class constructor specifying Image source to encode, whether to encode alpha, filter to use,     * and compression level.     *     * @param image A Java Image object     * @param encodeAlpha Encode the alpha channel? false=no; true=yes     * @param whichFilter 0=none, 1=sub, 2=up     * @param compLevel 0..9 (1 = best speed, 9 = best compression, 0 = no compression)     * @see java.awt.Image     */    public PngEncoder(Image image, boolean encodeAlpha, int whichFilter, int compLevel) {        this.image = image;        this.encodeAlpha = encodeAlpha;        setFilter(whichFilter);        if (compLevel >= 0 && compLevel <= 9) {            this.compressionLevel = compLevel;        }    }    /**     * Set the image to be encoded.     *     * @param image A Java Image object which uses the DirectColorModel     * @see java.awt.Image     * @see java.awt.image.DirectColorModel     */    public void setImage(Image image) {        this.image = image;        this.pngBytes = null;    }    /**     * Creates an array of bytes that is the PNG equivalent of the current image, specifying     * whether to encode alpha or not.     *     * @param encodeAlpha boolean false=no alpha, true=encode alpha     * @return an array of bytes, or null if there was a problem     */    public byte[] pngEncode(boolean encodeAlpha) {        byte[]  pngIdBytes = {-119, 80, 78, 71, 13, 10, 26, 10};        if (this.image == null) {            return null;        }        this.width = this.image.getWidth(null);        this.height = this.image.getHeight(null);        /*         * start with an array that is big enough to hold all the pixels         * (plus filter bytes), and an extra 200 bytes for header info         */        this.pngBytes = new byte[((this.width + 1) * this.height * 3) + 200];        /*         * keep track of largest byte written to the array         */        this.maxPos = 0;        this.bytePos = writeBytes(pngIdBytes, 0);        //hdrPos = bytePos;        writeHeader();        //dataPos = bytePos;        if (writeImageData()) {            writeEnd();            this.pngBytes = resizeByteArray(this.pngBytes, this.maxPos);        }        else {            this.pngBytes = null;        }        return this.pngBytes;    }    /**     * Creates an array of bytes that is the PNG equivalent of the current image.     * Alpha encoding is determined by its setting in the constructor.     *     * @return an array of bytes, or null if there was a problem     */    public byte[] pngEncode() {        return pngEncode(this.encodeAlpha);    }    /**     * Set the alpha encoding on or off.     *     * @param encodeAlpha  false=no, true=yes     */    public void setEncodeAlpha(boolean encodeAlpha) {        this.encodeAlpha = encodeAlpha;    }    /**     * Retrieve alpha encoding status.     *     * @return boolean false=no, true=yes     */    public boolean getEncodeAlpha() {        return this.encodeAlpha;    }    /**     * Set the filter to use.     *     * @param whichFilter from constant list     */    public void setFilter(int whichFilter) {        this.filter = FILTER_NONE;        if (whichFilter <= FILTER_LAST) {            this.filter = whichFilter;        }    }    /**     * Retrieve filtering scheme.     *     * @return int (see constant list)     */    public int getFilter() {        return this.filter;    }    /**     * Set the compression level to use.     *     * @param level the compression level (1 = best speed, 9 = best compression, 0 = no compression)     */    public void setCompressionLevel(int level) {        if (level >= 0 && level <= 9) {            this.compressionLevel = level;        }    }    /**     * Retrieve compression level.     *     * @return int (1 = best speed, 9 = best compression, 0 = no compression)     */    public int getCompressionLevel() {        return this.compressionLevel;    }    /**     * Increase or decrease the length of a byte array.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕亚洲电影| 久久 天天综合| 91免费看`日韩一区二区| 久久久电影一区二区三区| 六月丁香综合在线视频| 26uuu国产一区二区三区| 久久99精品久久久久久| 久久久久久久一区| 国产一区二区福利视频| 久久久电影一区二区三区| 亚洲最新视频在线播放| 欧美一区午夜视频在线观看| 日韩精品欧美精品| 精品三级av在线| 成人免费毛片片v| 国产精品乱码妇女bbbb| 99久久精品免费看| 亚洲成人久久影院| 欧美精品一卡二卡| 精品一二线国产| 国产精品久线在线观看| 一本久久精品一区二区| 性久久久久久久| 日韩欧美一级二级| 韩国精品在线观看| 欧美国产欧美亚州国产日韩mv天天看完整| www.亚洲国产| 亚洲欧美日韩一区二区 | 久久精品国产秦先生| 精品成人免费观看| 96av麻豆蜜桃一区二区| 亚洲国产欧美一区二区三区丁香婷 | 国产精品午夜久久| 91麻豆国产精品久久| 石原莉奈在线亚洲三区| 日本一区二区三区四区 | 亚洲伊人色欲综合网| 制服丝袜亚洲色图| 狠狠色丁香久久婷婷综合丁香| 亚洲国产精品av| 欧美午夜影院一区| 国产一区二区三区观看| 日韩福利视频网| 国产亚洲福利社区一区| 在线视频欧美区| 国产精品1024| 日韩电影免费在线| 国产精品视频在线看| 日韩欧美第一区| 欧美在线视频你懂得| 国产揄拍国内精品对白| 国产精品国产三级国产aⅴ原创 | 欧美日韩精品欧美日韩精品| 成人综合在线观看| 极品少妇xxxx精品少妇偷拍| 一区二区三区精品| 国产拍揄自揄精品视频麻豆| 欧美色倩网站大全免费| 成人福利视频网站| 美女一区二区三区| 亚洲韩国精品一区| 欧美一区二区三区在| 色欧美88888久久久久久影院| 国产乱国产乱300精品| 亚洲成人中文在线| 亚洲三级电影网站| 久久亚洲精品国产精品紫薇| 制服丝袜亚洲播放| 91精品国产综合久久久蜜臀图片| www.一区二区| 国产另类ts人妖一区二区| 另类人妖一区二区av| 亚洲综合精品自拍| 中文字幕日韩一区| 国产精品国产三级国产普通话蜜臀 | 亚洲精品一区二区三区蜜桃下载 | 国产日韩精品一区二区浪潮av | 欧美精品一区二区三区一线天视频| 在线免费观看视频一区| 一本大道综合伊人精品热热 | 秋霞电影一区二区| 亚洲一区二区三区四区不卡| 亚洲精品成人少妇| 亚洲精品成人精品456| 国产精品国产三级国产aⅴ无密码| 国产午夜精品一区二区三区四区| 欧美一区二区性放荡片| 91.com在线观看| 色综合久久综合网97色综合| 99v久久综合狠狠综合久久| 国产宾馆实践打屁股91| 久久精品国产一区二区| 国产综合成人久久大片91| 久久精品国产久精国产爱| 调教+趴+乳夹+国产+精品| 日韩va亚洲va欧美va久久| 午夜电影久久久| 日韩和欧美一区二区三区| 亚洲人成网站在线| 亚洲精品亚洲人成人网| 亚洲美女电影在线| 日本一区二区三区dvd视频在线| 亚洲欧美一区二区视频| 亚洲欧美日韩电影| 亚洲二区视频在线| 麻豆一区二区99久久久久| 国产一区二区三区在线观看免费| 国产一区二区网址| 91国偷自产一区二区开放时间 | 国产日本欧洲亚洲| 国产女人18毛片水真多成人如厕| 久久先锋影音av鲁色资源网| 国产精品不卡一区二区三区| 亚洲女同一区二区| 亚洲国产精品一区二区www在线| 久久电影网站中文字幕| 国产精品资源在线看| 99这里只有久久精品视频| 99久久综合国产精品| 日韩一级完整毛片| 国产婷婷一区二区| 午夜视频在线观看一区二区| 免费日本视频一区| 国产不卡在线一区| 欧美人妇做爰xxxⅹ性高电影| 久久综合九色综合97婷婷| 国产精品美女一区二区三区| 亚洲人成网站在线| 国产成人欧美日韩在线电影| 一本久久综合亚洲鲁鲁五月天| 欧美日韩视频在线观看一区二区三区 | 国产一区二区三区观看| 北条麻妃一区二区三区| 日韩午夜三级在线| 中文字幕一区二区视频| 亚洲午夜精品在线| 黄页网站大全一区二区| 高清不卡一区二区在线| 欧美浪妇xxxx高跟鞋交| 日韩三级伦理片妻子的秘密按摩| 中文字幕一区在线观看视频| 日韩电影在线免费看| 福利一区在线观看| 欧美日韩在线播放| 国产精品欧美一区二区三区| 亚洲精品v日韩精品| 精品一区二区三区影院在线午夜| 93久久精品日日躁夜夜躁欧美| 欧美一三区三区四区免费在线看 | 欧美大胆人体bbbb| 国产精品动漫网站| 国产成a人无v码亚洲福利| 在线播放欧美女士性生活| 一区在线观看免费| a美女胸又www黄视频久久| 7777精品伊人久久久大香线蕉完整版| 国产精品久久毛片av大全日韩| 亚洲国产精品天堂| 91香蕉视频mp4| 国产女人aaa级久久久级| 国产精品超碰97尤物18| 国产成+人+日韩+欧美+亚洲| 欧美电影免费观看高清完整版 | 91精品国产综合久久久蜜臀图片| 亚洲色图欧美在线| 国产一区二区免费在线| 精品免费日韩av| 黄色成人免费在线| 久久天天做天天爱综合色| 国产一区二区伦理| 国产人妖乱国产精品人妖| 成人丝袜高跟foot| 亚洲欧美日韩成人高清在线一区| av不卡免费电影| 一区二区三区欧美在线观看| 欧美自拍偷拍一区| 图片区小说区国产精品视频| 欧美精品第1页| 奇米综合一区二区三区精品视频 | 久久综合九色综合久久久精品综合 | 亚洲视频综合在线| 日本韩国欧美在线| 五月婷婷激情综合| 精品国产自在久精品国产| 国产黄人亚洲片| 亚洲视频一区在线观看| 欧美三级日韩在线| 激情欧美一区二区| 国产精品传媒在线| 欧美日韩高清不卡| 韩国午夜理伦三级不卡影院| 日本一区二区在线不卡| 欧美综合久久久| 精品伊人久久久久7777人| 国产人妖乱国产精品人妖| 欧美午夜寂寞影院| 九九**精品视频免费播放| 国产欧美日韩视频在线观看| 色婷婷激情一区二区三区| 美女性感视频久久|