How to Open and then Save Tiff Image using same or better resolution?
Posted on 2004-11-30
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
'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.Save(strPath & curF & ".tif", Drawing.Imaging.ImageFormat.Tiff)
curF = curF + 1
curF = 0
'set window caption
Me.Text = ImageCaption
'Displayes the frames
Me.Cursor = System.Windows.Forms.Cursors.Default