C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to Split multipage image into single page image


Posted Date: 02 May 2008    Resource Type: Code Snippets    Category: Images

Posted By: Asha Mathews       Member Level: Gold
Rating:     Points: 20



This code is used to split the multipage Tiff image into single single image using VB.net.
First imports system.drawing.imaging
for example: the tif file path is: "C:\test.tif"
You can pass the file path in below function


Imports system.drawing.imaging

Private Sub SplitImages(ByVal files As String)
'Dim FileSubString As String = System.IO.Path.GetFileNameWithoutExtension(files)
Dim pagecount, ImagePageCount As Integer
Dim oimage As System.Drawing.Image = Nothing
Dim fImage As Bitmap = Nothing
Dim pageLoad As Boolean = False
Dim docPath As String = "C:\"
Try
fImage = New Bitmap(files, False)
oimage = fImage
pagecount = oimage.GetFrameCount(FrameDimension.Page)
pageLoad = True
Catch ex As Exception
pageLoad = False
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
If pageLoad = True Then
If pagecount <> 0 Then
For ImagePageCount = 0 To pagecount - 1
Dim strScanKey As String = System.Guid.NewGuid.ToString
oimage.SelectActiveFrame(FrameDimension.Page, ImagePageCount)
Dim img1 As Drawing.Bitmap = CType(oimage.Clone, Drawing.Bitmap)
Dim documentPath As String = docPath & strScanKey & ".Tiff"
img1.Save(documentPath)
Next
End If
oimage.Dispose()
fImage.Dispose()
End If
End Sub




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Add an image dynamically
Previous Resource: Converting Image To Graycode
Return to Discussion Resource Index
Post New Resource
Category: Images


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use