Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Manipulating TIFF files in ASP.NET and VB.NET

fredfred Posts: 1Member
I am designing an application which will take the name of
an existing TIFF file and allow the user to view a listing
of the various pages contained in the TIFF, as well as
extract individual pages from the TIFF and save them as
separate files.

I am looking for information on manipulating TIFF's in
the .net framework using vb.net and asp.net.

Thanks very much for any help/direction you can offer.


Comments

  • WEBMASTERWEBMASTER Posts: 549Member
    Take a look at the Visual Studio .NET documentation, there's a lot of info about TIFF images and .NET do supports TIFF.

    The alternative is to look at vendors like:
    http://www.leadtools.com/



    [blue][italic][b]/WEBMASTER[/b][/italic][/blue]


  • tiffviewertiffviewer Posts: 1Member
    You can try out this [link=http://www.tiffviewer.net]C# VB.NET Tiff viewer[/link], you can also use to view [link=http://www.tiffviewer.net]TIFF files in ASP.NET[/link]

    Visit [link=http://www.tiffviewer.net]www.tiffviewer.net[/link]

    Why use so much costly, third party controls? :)
  • nextcmchirunextcmchiru Posts: 3Member
    Imports System.IO

    Class Application

    Public Shared Sub processTiffFile(filename As String)
    ' Open a Stream and decode a TIFF image
    Dim imageStreamSource As New FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)
    Dim decoder As New TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)

    ' loop through the frames.
    For i As Integer = 0 To (decoder.Frames.Count - 1)

    Dim bitmapSource As BitmapSource = decoder.Frames(i)
    Dim encoder As New JpegBitmapEncoder()
    Dim stream As New FileStream("frame" + Convert.ToString(i) + ".jpg", FileMode.Create)

    ' Draw the Image
    Dim myImage As New Image()
    myImage.Source = bitmapSource
    myImage.Stretch = Stretch.None

    encoder.Frames.Add(BitmapFrame.Create(bitmapSource))
    encoder.Save(stream)
    Next

    End Sub



    ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
    ' can be handled in this file.
    Private Sub App_Startup(ByVal sender As Object, ByVal e As StartupEventArgs)
    ' Application is running
    ' Process command line args
    Dim startMinimized As Boolean = False
    Dim showWindow As Boolean
    showWindow = True

    For i As Integer = 0 To (e.Args.Length - 1)
    If e.Args(i).ToLower().EndsWith(".gif") Then
    ' startMinimized = True
    processTiffFile(e.Args(i))
    showWindow = False
    End If
    Next

    If Not showWindow Then
    Environment.Exit(0)
    End If

    End Sub
    End Class


    Imports System.IO
    Imports System.Windows.Forms

    Class MainWindow


    Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
    Dim openFileDialog1 As New OpenFileDialog()
    openFileDialog1.InitialDirectory = ""
    openFileDialog1.Filter = "TIFF files (*.tif;*.tiff) |*.tiff;*.tif"
    openFileDialog1.FilterIndex = 0
    If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then

    Application.processTiffFile(openFileDialog1.FileName)
    MessageBox.Show("Processing complete. The frames were split up and stored in the same directory as this program's exe.")
    End If
    End Sub
    End Class





  • nextcmchirunextcmchiru Posts: 3Member
    herer is the code for it :

    Imports System.IO

    Class Application

    Public Shared Sub processTiffFile(filename As String)
    ' Open a Stream and decode a TIFF image
    Dim imageStreamSource As New FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)
    Dim decoder As New TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)

    ' loop through the frames.
    For i As Integer = 0 To (decoder.Frames.Count - 1)

    Dim bitmapSource As BitmapSource = decoder.Frames(i)
    Dim encoder As New JpegBitmapEncoder()
    Dim stream As New FileStream("frame" + Convert.ToString(i) + ".jpg", FileMode.Create)

    ' Draw the Image
    Dim myImage As New Image()
    myImage.Source = bitmapSource
    myImage.Stretch = Stretch.None

    encoder.Frames.Add(BitmapFrame.Create(bitmapSource))
    encoder.Save(stream)
    Next

    End Sub



    ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
    ' can be handled in this file.
    Private Sub App_Startup(ByVal sender As Object, ByVal e As StartupEventArgs)
    ' Application is running
    ' Process command line args
    Dim startMinimized As Boolean = False
    Dim showWindow As Boolean
    showWindow = True

    For i As Integer = 0 To (e.Args.Length - 1)
    If e.Args(i).ToLower().EndsWith(".gif") Then
    ' startMinimized = True
    processTiffFile(e.Args(i))
    showWindow = False
    End If
    Next

    If Not showWindow Then
    Environment.Exit(0)
    End If

    End Sub
    End Class


    Imports System.IO
    Imports System.Windows.Forms

    Class MainWindow


    Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
    Dim openFileDialog1 As New OpenFileDialog()
    openFileDialog1.InitialDirectory = ""
    openFileDialog1.Filter = "TIFF files (*.tif;*.tiff) |*.tiff;*.tif"
    openFileDialog1.FilterIndex = 0
    If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then

    Application.processTiffFile(openFileDialog1.FileName)
    MessageBox.Show("Processing complete. The frames were split up and stored in the same directory as this program's exe.")
    End If
    End Sub
    End Class





  • nextcmchirunextcmchiru Posts: 3Member
    herer is the code for it :

    Imports System.IO

    Class Application

    Public Shared Sub processTiffFile(filename As String)
    ' Open a Stream and decode a TIFF image
    Dim imageStreamSource As New FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read)
    Dim decoder As New TiffBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default)

    ' loop through the frames.
    For i As Integer = 0 To (decoder.Frames.Count - 1)

    Dim bitmapSource As BitmapSource = decoder.Frames(i)
    Dim encoder As New JpegBitmapEncoder()
    Dim stream As New FileStream("frame" + Convert.ToString(i) + ".jpg", FileMode.Create)

    ' Draw the Image
    Dim myImage As New Image()
    myImage.Source = bitmapSource
    myImage.Stretch = Stretch.None

    encoder.Frames.Add(BitmapFrame.Create(bitmapSource))
    encoder.Save(stream)
    Next

    End Sub



    ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
    ' can be handled in this file.
    Private Sub App_Startup(ByVal sender As Object, ByVal e As StartupEventArgs)
    ' Application is running
    ' Process command line args
    Dim startMinimized As Boolean = False
    Dim showWindow As Boolean
    showWindow = True

    For i As Integer = 0 To (e.Args.Length - 1)
    If e.Args(i).ToLower().EndsWith(".gif") Then
    ' startMinimized = True
    processTiffFile(e.Args(i))
    showWindow = False
    End If
    Next

    If Not showWindow Then
    Environment.Exit(0)
    End If

    End Sub
    End Class


    Imports System.IO
    Imports System.Windows.Forms

    Class MainWindow


    Private Sub Button2_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button2.Click
    Dim openFileDialog1 As New OpenFileDialog()
    openFileDialog1.InitialDirectory = ""
    openFileDialog1.Filter = "TIFF files (*.tif;*.tiff) |*.tiff;*.tif"
    openFileDialog1.FilterIndex = 0
    If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then

    Application.processTiffFile(openFileDialog1.FileName)
    MessageBox.Show("Processing complete. The frames were split up and stored in the same directory as this program's exe.")
    End If
    End Sub
    End Class





  • talerKKtalerKK Posts: 8Member
    hi ,

    I have several years' experiences on image processing with .NET. as for tiff programming ,I strongly recommend [link=http://www.rasteredge.com/how-to/csharp-imaging/multipage-tiff-processing/]tiff processing lib[/link] written in ASP.NET,C#,VB.NET .you can choose what you need.and more [link=http://www.rasteredge.com/how-to/csharp-imaging/tiff-processing/]tiff procesing guide lines[/link] are avaliable here.Just donwload the free trial package and follow the steps.hope you succeed.

    regards.
  • dannyroughdannyrough Posts: 18Member
    I do this almost daily. I use a [link=http://www.rasteredge.com/how-to/vb-net-imaging/tiff-processing/][color=Black]tiff processing programme[/color][/link] found on the internet . Install it and it becomes a selectable merger option.Then you can [link=http://www.rasteredge.com/how-to/vb-net-imaging/tiff-merge/][color=Black]merge tiffs into one[/color][/link] in any program at all, including Adobe Acrobat . Just open the tiffs, select merge, and choice the form you want, the task will be finished in several seconds. if you haven't found a good choice , you can have a try. best wishes.
  • arronleearronlee Posts: 29Member

    Using code to deal with Tiff manipulating is too complicated for me. Do you have any processing tools to recommend? Thanks in advance.

    Best regards, Arron

Sign In or Register to comment.