网页缩略图工具包

今天发现了一个实现网页缩略图的工具包,比较不错,唯一缺陷就是需要调用浏览器api:

使用如下:

 

 

package net.dapper.scrender.examples;

import java.io.File;

import net.dapper.scrender.Scrender;


public class RendererExample
{

	
	public static void main(String[] args) throws Exception
	{
		// Create a standard self-disposing scrender object :
		Scrender scrender = new Scrender();
		scrender.init();
		// render it ( and dispose when finish):
		scrender.render("http://scrender.sourceforge.net", new File("./scrender.index.html.jpg"));
		
		// Creae a second scrender object , one that is continuous ( meaning , you can make all the screenshots
		// you want but you have to dispose it yourself )
		Scrender scrender2 = new Scrender(true);
		scrender2.init();
		scrender2.render("http://www.google.com", new File("./google.com.jpg"));
		scrender2.render("http://www.yahoo.com", new File("./yahoo.com.jpg"));
		scrender2.dispose();
	
	}
}

 

你可能感兴趣的:(缩略图)