GdPicture.NET使用教程:多页TIFF文件的页面添加

原创|使用教程|编辑:龚雪|2015-12-09 14:40:53.000|阅读 226 次

概述:本文将对GdPicture.NET中多页TIFF文件的页面的添加进行简单介绍。其中给出了3种方法,代码可供参考。

# 项目交付用正版,省下一台Iphone12 # # 31款JAVA开发必备控件和工具 #

相关链接:

GdPicture.NET是一款功能全面且可无限分发的文档图像处理的一体化工具包。其一体化主要包含:PDF、图像处理、文档影像、扫描、条形码、打印、OCR、表单处理、注释等。本文将简单介绍在GdPicture.NET中多页TIFF文件的页面的添加。

【GdPicture.NET最新下载】

这里讲提供三种方法,给出了代码可供参考:

1、末尾的添加

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
oGdPictureImaging.TiffAppendPageFromFile(ImageID, "addition.tif")
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)

oGdPictureImaging.ReleaseGdPictureImage(ImageID)

可用上面相同的方法添加一个页面保存为GdPictureImage

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
Dim AddImgID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("addition.tif")
oGdPictureImaging.TiffAppendPageFromGdPictureImage(ImageID, AddImgID)
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(AddImgID)

2、通过创建TiffSaveAsMultiPageFile()方法将页面到文件末尾

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID, TiffID As Integer
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("image1.tif")
oGdPictureImaging.TiffSaveAsMultiPageFile(ImageID, "multipage.tif", TiffCompression.TiffCompressionAUTO)
'At this step ImageID1 handles a reference to the multipage tiff stream.
TiffID = ImageID
'adding a second page in the multipage stream from image2.tif
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("image2.tif")
oGdPictureImaging.TiffAddToMultiPageFile(TiffID, ImageID)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.TiffCloseMultiPageFile(TiffID) 'end the file
oGdPictureImaging.ReleaseGdPictureImage(TiffID) 'releasing the input bitmap from the memory

3、任意位置的添加

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
oGdPictureImaging.TiffInsertPageFromFile(ImageID, 3, "addition.tif")
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer
Dim AddImgID As Integer
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
AddImgID = oGdPictureImaging.CreateGdPictureImageFromFile("addition.tif")
oGdPictureImaging.TiffInsertPageFromGdPictureImage(ImageID, 3, AddImgID)
oGdPictureImaging.TiffSaveMultiPageToFile(ImageID, "multipageAdded.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
oGdPictureImaging.ReleaseGdPictureImage(AddImgID)

我可以看到其基本方法:Add—Save—Released

本文译自GdPicture.NET

购买最新正版授权!"咨询在线客服"

慧都年终盛典火爆开启,一年仅一次的最强促销,破冰钜惠不容错过!!优惠详情点击查看>>



标签:.NET图像处理

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,尊重他人劳动成果

登录 慧都网发表评论


慧都网友 2015-12-09 14:44:43.000
0

感觉挺有用的,可收藏。


为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
相关厂商
相关产品
GdPicture.NET

一款功能全面且可无限分发的.Net文档图像处理工具包