Asp.net| thumbnails when we want to upload images, we often need to generate thumbnails, we used to use a Third-party control to complete. In ASP.net, use the following methods to easily handle
<script language= "VB" runat= "Server" >
Sub Page_Load (sender as Object, E as EventArgs)
Dim Image,anewimage as System.Drawing.Image
Dim width,height,newwidth,newheight As Integer
Dim CALLB as System.Drawing.Image.GetThumbnailImageAbort
' Generate thumbnails
Image=system.drawing.image.fromfile (Server.MapPath ("classpic/" + "rs1.jpg"))
Width=image. Width
Height=image.height
If Width>height Then
newwidth=110
Newheight=image.height/image. Width*newwidth
Else
newheight=110
Newwidth=image. Width/image.height*newheight
End If
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service