Multipage TIff Image Convert to Single page Gif

Hi, I need to write an application in that take all existing tiff files and convert them into Gif so they can viewable by our website.  Here are two main requirements.  Any code would help.

1. We can't buy third party control/Application
2. Each Tiff image are Multiple Pages, So each page of the tiff must be saved as a gif.
Who is Participating?
Bob LearnedConnect With a Mentor Commented:
You could start with this, and see if you can find a way:

Imports System
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.IO
Public Class TiffImage
    Public Sub New(ByVal fileName As String)
        _fileName = fileName
    End Sub
    Private _fileName As String
    Public ReadOnly Property FileName() As String
            Return _fileName
        End Get
    End Property
    Public ReadOnly Property PageCount() As Integer
            ' Get the frame dimension list from the image of the file and 
            Dim image As Image = Image.FromFile(FileName)
            ' Get the globally unique identifier (GUID) 
            Dim objGuid As Guid = image.FrameDimensionsList(0)
            ' Create the frame dimension 
            Dim frameDimension As New FrameDimension(objGuid)
            'Gets the total number of frames in the .tiff file 
            Return image.GetFrameCount(frameDimension)
        End Get
    End Property
    ' Return the memory stream of a specific page 
    Public Function GetTiffSpecificPage(ByVal pageNumber As Integer) As Image
        Dim image As Image = Image.FromFile(Me.FileName)
        Using ms As New MemoryStream()
            Dim objGuid As Guid = image.FrameDimensionsList(0)
            Dim objDimension As New FrameDimension(objGuid)
            image.SelectActiveFrame(objDimension, pageNumber)
            image.Save(ms, ImageFormat.Bmp)
            Dim retImage As Image = Image.FromStream(ms)
            Return retImage
        End Using
    End Function
End Class

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.