获取文档内容缩略图的方法

1:将文档用虚拟打印转换成.tif文件.

2.分割.tif文件,取第一页并生成缩略图,示例代码如下:

 

ContractedBlock.gif ExpandedBlockStart.gif 代码
 
     
using (image = Image.FromFile(tagFilename))
{
Guid guid
= (Guid)image.FrameDimensionsList.GetValue( 0 );
FrameDimension dimension
= new FrameDimension(guid);
int pageCount = image.GetFrameCount(dimension);
image.SelectActiveFrame(dimension,
0 );
image
= image.GetThumbnailImage( 100 , 100 , new Image.GetThumbnailImageAbort( delegate () { return false ; }), IntPtr.Zero);
image.Save(tifFirstFrameBuff, ImageFormat.Gif);
image.Dispose();
}

 

转载于:https://www.cnblogs.com/wudingfeng/archive/2010/01/22/1654102.html

你可能感兴趣的:(获取文档内容缩略图的方法)