彩票走势图

GdPicture.NET文件转换教程连载:多页TIFF转换为BMP

原创|其它|编辑:郝浩|2012-12-20 09:51:35.000|阅读 326 次

概述:使用GdPicture.NET图形处理控件不仅能将图像扫描成TIFF格式,并能将多页的TIFF文件转换为BMP格式文件,无疑给了图像处理更多的选择。

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

相关链接:

使用GdPicture.NET图形处理控件不仅能将图像扫描成TIFF格式,并能将多页的TIFF文件转换为BMP格式文件,无疑给了图像处理更多的选择。

》》》下载GdPicture.NET最新试用版

示例代码:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim oGdPictureImaging As New GdPicture.GdPictureImaging
        oGdPictureImaging.SetLicenseNumber("XXXX") 'Replace XXXX by a valid or commercial KEY

        Dim InputImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("")
        Dim PageCount As Integer = 1

        If oGdPictureImaging.GetStat = GdPictureStatus.OK Then
            If oGdPictureImaging.TiffIsMultiPage(InputImageID) Then
                PageCount = oGdPictureImaging.TiffGetPageCount(InputImageID)
            End If

            For I As Integer = 1 To PageCount
                If I > 1 Then
                    oGdPictureImaging.TiffSelectPage(InputImageID, I)
                End If
                Dim TmpImageID As Integer = oGdPictureImaging.CreateClonedGdPictureImage(InputImageID)
                If oGdPictureImaging.GetStat = GdPictureStatus.OK Then
                    oGdPictureImaging.Resize(TmpImageID, 1728, 2286, Drawing2D.InterpolationMode.HighQualityBicubic)
                    oGdPictureImaging.SaveAsBMP(TmpImageID, "output" + Str(I) + ".bmp")
                    oGdPictureImaging.ReleaseGdPictureImage(TmpImageID)
                Else
                    MsgBox("Error on page " + Str(I) + ": " + oGdPictureImaging.GetStat.ToString)
                End If
            Next I

            oGdPictureImaging.ReleaseGdPictureImage(InputImageID)
            MsgBox("Done !")
        Else
            MsgBox("Can't open selected file !")
        End If
    End Sub

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@cahobeh.cn

文章转载自:慧都控件网

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP