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

📄 sunjpegformatter.java

📁 openmap java写的开源数字地图程序. 用applet实现,可以像google map 那样放大缩小地图.
💻 JAVA
字号:
// **********************************************************************// // <copyright>// //  BBN Technologies//  10 Moulton Street//  Cambridge, MA 02138//  (617) 873-8000// //  Copyright (C) BBNT Solutions LLC. All rights reserved.// // </copyright>// **********************************************************************// // $Source:// /cvs/distapps/openmap/src/openmap/com/bbn/openmap/image/SunJPEGFormatter.java,v// $// $RCSfile: SunJPEGFormatter.java,v $// $Revision: 1.3.2.2 $// $Date: 2005/08/09 19:18:31 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.image;import java.awt.image.BufferedImage;import java.util.Properties;import com.bbn.openmap.util.Debug;import com.bbn.openmap.util.PropUtils;public class SunJPEGFormatter extends AbstractImageFormatter {    public static final String QualityProperty = "imagequality";    protected float imageQuality = .8f;    public SunJPEGFormatter() {}    public void setProperties(String prefix, Properties props) {        imageQuality = PropUtils.floatFromProperties(props,                (prefix == null ? "" : prefix) + QualityProperty,                imageQuality);        if (Debug.debugging("image")) {            Debug.output("SunJPEGFormatter setting image quality to: "                    + imageQuality);        }    }    public ImageFormatter makeClone() {        SunJPEGFormatter formatter = new SunJPEGFormatter();        formatter.setImageQuality(getImageQuality());        return formatter;    }    public float getImageQuality() {        return imageQuality;    }    /** For this formatter, image quality is a number in the 0-1 range. */    public void setImageQuality(float quality) {        imageQuality = quality;    }    public byte[] formatImage(BufferedImage bi) {        try {            return JPEGHelper.encodeJPEG(bi, imageQuality);        } catch (java.io.IOException ioe) {            Debug.error("SunJPEGFormatter caught IOException formatting image!");            return new byte[0];        }    }    /**     * Get the Image Type created by the ImageFormatter. These     * responses should adhere to the OGC WMT standard format labels.     * Some are listed in the WMTConstants interface file.     */    public String getFormatLabel() {        return WMTConstants.IMAGEFORMAT_JPEG;    }}

⌨️ 快捷键说明

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