Modificare il file:
\Galleria\thumbnail.aspx
http://www.developer.com/net/asp/article.php/3098311 'with proportional resizing <%@ Import Namespace=System.Drawing %> <%@ Import Namespace=System %> <%@ Import Namespace=System.Web %> <html> <script language="VB" runat="server"> Sub Page_Load(Sender As Object, E As EventArgs) ' Initialize objects Dim objImage, objThumbnail As System.Drawing.Image Dim strServerPath, strFilename As String Dim shtWidth, shtHeight As Short ' Get image folder path on server - use "\" string if root ' strServerPath = Server.MapPath("WebAppImageFolder\") ' Retrieve name of file to resize from query string ' strFilename = strServerPath & Request.QueryString("filename") strFilename = Request.QueryString("FileName") ' Retrieve file, or error.gif if not available Try objImage = objImage.FromFile(strFilename) Catch objImage = objImage.FromFile(strServerPath & "error.gif") End Try ' Retrieve width from query string If Request.QueryString("width") = Nothing Then shtWidth = objImage.Width ElseIf Request.QueryString("width") < 1 Then shtWidth = 100 Else shtWidth = Request.QueryString("width") End If ' Work out a proportionate height from width shtHeight = objImage.Height / (objImage.Width / shtWidth) ' Create thumbnail objThumbnail = objImage.GetThumbnailImage(shtWidth, _ shtHeight, Nothing, System.IntPtr.Zero) ' Send down to client Response.ContentType = "image/jpeg" objThumbnail.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg) ' Tidy up objImage.Dispose() objThumbnail.Dispose() End Sub </script> </html>
[
Íàçàä
]