Multipage TIff Image Convert to Single page Gif

Posted on 2009-02-23
Last Modified: 2013-11-26
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.
Question by:vb7guy
    1 Comment
    LVL 96

    Accepted Solution

    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


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now