当前位置: 首页>>代码示例>>Java>>正文


Java ChartUtilities.writeBufferedImageAsJPEG方法代码示例

本文整理汇总了Java中org.jfree.chart.ChartUtilities.writeBufferedImageAsJPEG方法的典型用法代码示例。如果您正苦于以下问题:Java ChartUtilities.writeBufferedImageAsJPEG方法的具体用法?Java ChartUtilities.writeBufferedImageAsJPEG怎么用?Java ChartUtilities.writeBufferedImageAsJPEG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.ChartUtilities的用法示例。


在下文中一共展示了ChartUtilities.writeBufferedImageAsJPEG方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeBufferedImage

import org.jfree.chart.ChartUtilities; //导入方法依赖的package包/类
public void writeBufferedImage(OutputStream out, BufferedImage image, ImageTypes imgType)
throws KMException {
    if ( imgType == null) imgType = ImageTypes.PNG;  // default

    try {
        if (imgType == ImageTypes.PNG) ChartUtilities.writeBufferedImageAsPNG(out, image);
        else if (imgType == ImageTypes.JPEG) ChartUtilities.writeBufferedImageAsJPEG(out, image);
        else {
            logger.debug(new String("UnSupported File Format: " + imgType.getValue()));
            throw new KMException( "UnSupported File Format: " + imgType.getValue());
        }
    } catch (IOException ioe) {
        logger.debug(ioe);
        throw new KMException(ioe);
    }

}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:18,代码来源:JFreeChartIKMPlottermpl.java

示例2: drawing

import org.jfree.chart.ChartUtilities; //导入方法依赖的package包/类
private void drawing(OutputStream out, DrawInfo drawInfo)
		throws IOException {
	if (drawInfo.getPlusObj() != null && drawInfo.getQuality() == -1) {
		BufferedImage image = (BufferedImage) drawInfo.getPlusObj();
		ChartUtilities.writeBufferedImageAsJPEG(out, image);
	} else {
		ChartUtilities.writeChartAsJPEG(out, drawInfo.getQuality(),
				drawInfo.getChart(), drawInfo.getWidth(),
				drawInfo.getHeight(), drawInfo.getInfo());
	}
	drawInfo = null;
}
 
开发者ID:jbeetle,项目名称:BJAF3.x,代码行数:13,代码来源:DrawController.java

示例3: copy

import org.jfree.chart.ChartUtilities; //导入方法依赖的package包/类
private void copy(OutputStream os, JFreeChart jfc, ChartRenderingInfo info) throws ApplicationException, IOException, ExpressionException {
	//OutputStream os = null;
	try {
		//os = res.getOutputStream();
		
		BufferedImage bi;
		if (format==FORMAT_JPG) {
			bi = jfc.createBufferedImage(chartwidth,chartheight,BufferedImage.TYPE_INT_RGB,info);
		} else {
			bi = jfc.createBufferedImage(chartwidth,chartheight,info);
		}
		Image img;
		
		// add border
		if(showborder) {
			try {
				img = new Image(bi);
				img.addBorder(1,Color.BLACK,Image.BORDER_TYPE_CONSTANT);
				bi=img.getBufferedImage();
			}
			catch (PageException e) {}
		}
		if(format==FORMAT_PNG)		ChartUtilities.writeBufferedImageAsPNG(os, bi);
		else if(format==FORMAT_JPG)	ChartUtilities.writeBufferedImageAsJPEG(os, bi);
		else if(format==FORMAT_GIF)	{
			img = new lucee.runtime.img.Image(bi);
			img.writeOut(os, "gif",1,true);
			
			//throw new ApplicationException("format gif not supported");
		}
		else if(format==FORMAT_FLASH)throw new ApplicationException("format flash not supported");
	}
	finally {
		IOUtil.flushEL(os);
		IOUtil.closeEL(os);
	}
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:38,代码来源:Chart.java

示例4: writeBufferedImageAsJPEG

import org.jfree.chart.ChartUtilities; //导入方法依赖的package包/类
public void writeBufferedImageAsJPEG(OutputStream out, BufferedImage image) throws IOException {
    ChartUtilities.writeBufferedImageAsJPEG(out, image);
}
 
开发者ID:NCIP,项目名称:caintegrator,代码行数:4,代码来源:JFreeChartIKMPlottermpl.java


注:本文中的org.jfree.chart.ChartUtilities.writeBufferedImageAsJPEG方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。