原創|其它|編輯:郝浩|2012-12-20 09:51:35.000|閱讀 367 次
概述:使用GdPicture.NET圖形處理控件不僅能將圖像掃描成TIFF格式,并能將多頁的TIFF文件轉換為BMP格式文件,無疑給了圖像處理更多的選擇。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
使用GdPicture.NET圖形處理控件不僅能將圖像掃描成TIFF格式,并能將多頁的TIFF文件轉換為BMP格式文件,無疑給了圖像處理更多的選擇。
示例代碼:
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@fc6vip.cn
文章轉載自:慧都控件網