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(strFileP ath, True)
Dim objGuid As Guid = (objImage.FrameDimensionsL ist(0))
Dim objDimension As System.Drawing.Imaging.Fra meDimensio n = New System.Drawing.Imaging.Fra meDimensio n(objGuid)
'Gets the total number of frames in the .tiff file
totFrame = objImage.GetFrameCount(obj Dimension)
'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 (objDimens ion, curF)
objImage.s()
objImage.Save(strPath & curF & ".tif", Drawing.Imaging.ImageForma t.Tiff)
curF = curF + 1
Next
curF = 0
'set window caption
Me.Text = ImageCaption
'Displayes the frames
DisplayFrame()
resizePicImage()
Me.Cursor = System.Windows.Forms.Curso rs.Default
Thanks, Here is my code...(need fixed ASAP, so price is high)
'Sets the tiff file as an image object.
objImage = objImage.FromFile(strFileP
Dim objGuid As Guid = (objImage.FrameDimensionsL
Dim objDimension As System.Drawing.Imaging.Fra
'Gets the total number of frames in the .tiff file
totFrame = objImage.GetFrameCount(obj
'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
objImage.s()
objImage.Save(strPath & curF & ".tif", Drawing.Imaging.ImageForma
curF = curF + 1
Next
curF = 0
'set window caption
Me.Text = ImageCaption
'Displayes the frames
DisplayFrame()
resizePicImage()
Me.Cursor = System.Windows.Forms.Curso
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.