Link to home
Start Free TrialLog in
Avatar of onyak
onyak

asked on

How to Open and then Save Tiff Image using same or better resolution?

I have code that opens Tiff files and then saves each frame in the Tiff files locally. The problem is that the quality is destroyed, so you when you zoom in on the images it looks really bad.  How can I fix this?  There has to be a way to get the resolution from the original image and save in that format, right?

Thanks,  Here is my code...(need fixed ASAP, so price is high)

'Sets the tiff file as an image object.
        objImage = objImage.FromFile(strFilePath, True)
        Dim objGuid As Guid = (objImage.FrameDimensionsList(0))
        Dim objDimension As System.Drawing.Imaging.FrameDimension = New System.Drawing.Imaging.FrameDimension(objGuid)

        'Gets the total number of frames in the .tiff file
        totFrame = objImage.GetFrameCount(objDimension)

        'Adds number of frames to the combo box for displaying purposes.
        Dim i As Integer
        For i = 0 To totFrame - 1
            cboFrameNo.Items.Add(i)
        Next
        cboFrameNo.Items.IndexOf(1)

        'Sets the temporary folder to "C:\temp\"
        strPath = "c:\temp\" & _instance

        'Saves every frame as a seperate file.
        Dim z As Integer
        z = 0
        curF = 0
        For z = 0 To (totFrame - 1)
            objImage.SelectActiveFrame(objDimension, curF)
            objImage.s()
            objImage.Save(strPath & curF & ".tif", Drawing.Imaging.ImageFormat.Tiff)
            curF = curF + 1
        Next

        curF = 0

        'set window caption
        Me.Text = ImageCaption

        'Displayes the frames
        DisplayFrame()
        resizePicImage()
        Me.Cursor = System.Windows.Forms.Cursors.Default
ASKER CERTIFIED SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial