Hi guys, I have a resizing page that I use to resize all of the images on my local server. However now, I want to be able to read files from another website using the full URL, and resize them on the fly. However the code that I have only works with local files. I was wondering if anyone could point me in the right direction with this issue. I am sure that I have use the Stream Reader in some way, I just can't figure it out. Any help would be really appreciated!
Thanks
<code>
Sub Page_load(ByVal sender As Object, ByVal e As EventArgs)
Try
Dim objImage, objThumbnail As System.Drawing.Image
Dim strServerPath, strFilename As String
Dim shtWidth, shtHeight As Short
strServerPath = Server.MapPath("")
strFilename = httpcontext.current.Request.QueryString("filename")
Try
objImage = objImage.FromFile(Server.MapPath(strFileName))
Catch
objImage = objImage.FromFile(StrServerPath &"\"&"images\noimage.jpg")
End Try
If Request.QueryString("width") = Nothing Then
shtWidth = objImage.Width
ElseIf Request.QueryString("width") < 1 Then
shtWidth = 100
Else
shtWidth = Request.QueryString("width")
End If
shtHeight = objImage.Height / (objImage.Width / shtWidth)
objThumbnail = objImage.GetThumbnailImage(shtWidth, shtHeight, Nothing, System.IntPtr.Zero)
Response.ContentType = "image/jpeg"
objThumbnail.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg)
objImage.Dispose()
objThumbnail.Dispose()
Catch ex as exception
response.write(ex.tostring &"<br/>")
End try
end sub
</code>