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

📄 acmegifformatter.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/AcmeGifFormatter.java,v $// $RCSfile: AcmeGifFormatter.java,v $// $Revision: 1.2.2.1 $// $Date: 2004/10/14 18:26:57 $// $Author: dietrick $// // **********************************************************************package com.bbn.openmap.image;import com.bbn.openmap.util.Debug;import java.util.*;import java.awt.image.BufferedImage;/** * This formatter requires the Acme.JPM.Encoders package. That code * can be found at <a * href="http://www.acme.com/java">http://www.acme.com/java </a>. */public class AcmeGifFormatter extends AbstractImageFormatter {    public AcmeGifFormatter() {}    public void setProperties(String prefix, Properties props) {}    public ImageFormatter makeClone() {        return new AcmeGifFormatter();    }    public byte[] formatImage(BufferedImage bi) {        try {            return AcmeGifHelper.encodeGif(bi);        } catch (java.io.IOException ioe) {            Debug.error("AcmeGifFormatter caught IOException formatting image!\n  "                    + ioe);            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_GIF;    }    /**     * Return the applicable Graphics to use to paint the layers into.     * If the internal BufferedImage hasn't been created yet, or has     * been set to null, then a new buffered Image is created, set to     * the size specified by the height and width. The ImageGenerator     * extends MapBean. Remember to dispose of the graphics object     * when you are done with it. Uses the BufferedImage.TYPE_INT_ARGB     * colormodel.     *      * @param width pixel width of Graphics.     * @param height pixel height of Graphics.     * @return java.awt.Graphics object to use.     * @see java.awt.image.BufferedImage     */    public java.awt.Graphics getGraphics(int width, int height) {        return getGraphics(width, height, BufferedImage.TYPE_INT_ARGB);    }}

⌨️ 快捷键说明

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