Hi all,
I m using Windows XP pro OS and frontend is ASP.Net . I want to open a tif file within the .aspx web page.Now I am able to open .tif file in default Microsoft office document Imaging .But i want to display the .tif image file in web page, so that it can be viewed in a HML Frame .Can anyone help me ? Please reply soon.
And I want To Write Free Handle On The Tiff File
Please Please Help Me Quick
KAXND
Private Sub ConvertImage(ByVal FilePath As String, ByVal Width As Integer, ByVal Heght As Integer)
If Not FilePath = "" Then
Dim ArrFiles() As String = Directory.GetFiles(Server.MapPath(".") & "\ImageCache")
For Each f As String In ArrFiles
File.Delete(f)
Next
Dim _stream As System.IO.Stream = File.Open(FilePath, FileMode.Open)
Dim _bmp As New Bitmap(Image.FromStream(_stream), Width, Heght)
Context.Response.ContentType = "image/jpeg"
Dim FileConvert As String = Server.MapPath(".") & "\ImageCache\" & Me.GetFileName(FilePath) & ".jpg"
If Not File.Exists(FileConvert) Then
_bmp.Save(FileConvert, ImageFormat.Jpeg)
End If
_bmp.Dispose()
_stream.Close()
End If
End Sub
Private Function GetFileName(ByVal FilePath As String)
Dim ArrFileName() As String = FilePath.Split("\")
Dim FileName() As String = ArrFileName(ArrFileName.Length - 1).Split(".")
Return FileName(0)
End Function
Public Sub LoadImage(ByVal FileName As String)
Dim path As String = "~\ImageCache\" & FileName & ".jpg"
Image1.Src = path
End Sub
Protected Sub btLoad_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btLoad.Click
Dim FileName As String = Me.GetFileName(FileUpLoad.Value)
Me.ConvertImage(FileUpLoad.Value, 800, 1100)
Me.LoadImage(FileName)
End If
End Sub