當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。