在多页TIFF上应用压缩

时间:2015-08-12 12:03:55

标签: wia

我有以下代码需要List WIA.ImageFile并从这些文件创建多页TIFF:

Function MakeTiff(images As List(Of Object))
    Const wiaFormatTIFF = "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}"
    Dim ip = AutomationFactory.CreateObject("WIA.ImageProcess")
    Dim frameFilterID = ip.FilterInfos("Frame").FilterID
    For i = 2 To images.Count
        ip.Filters.Add(frameFilterID)
        ip.Filters(i - 1).Properties("ImageFile") = images(i - 1)
    Next
    ip.Filters.Add(ip.FilterInfos("Convert").FilterID)
    ip.Filters(ip.Filters.Count).Properties("FormatID") = wiaFormatTIFF
    Return ip.Apply(images(0))
End Function

如何压缩生成的TIFF文件(假设它尚未压缩)?

1 个答案:

答案 0 :(得分:0)

我正在使用wia 2.0设置:

.Properties("6146").Value = 1    '4 is Black-white,gray is 2, color 1
.Properties("6147").Value = 200  'dots per inch/horizontal
.Properties("6148").Value = 200  'dots per inch/vertical
.Properties("4107").Value = 5    '0 = NONE, JPG = 5, PNG = 8 *WiaCompressionMode

它在VB.net和VBA中工作,压缩98%