soulcode
asked on
How do I resize the height/width of an image in ratio after upload !!
Hi People,
Im using the following control in asp.net to allow users to upload an image to the server::
<INPUT id="ctlLogoFile" type="file" name="Pic" runat="server" size="15">
I want to be able to take the image, resize it in ratio so it will fit within 200x200 bounds, then save it on the server as a file.
I have code to save the image to the server, just no code to resize image. Its similar to creating a thumbnail image, just making sure the height and width ratio stays in tact.
Help me! :o( i've bee trying to find a solution for this for weeks!!
Hi soulcode,
here are 2 very good examples:
http://aspnet.4guysfromrolla.com/articles/012203-1.aspx
http://www.plus.hr/skripte/asp.net/resize_image.html
Regards!
B..M
here are 2 very good examples:
http://aspnet.4guysfromrolla.com/articles/012203-1.aspx
http://www.plus.hr/skripte/asp.net/resize_image.html
Regards!
B..M
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
call it like so:
Dim IncomingFile As IO.FileInfo
Dim ImageSource, PriceValue As String
Dim ImageResizer As New ResizeImage(True, 400, 300)
ImageResizer.ThumbX = 100
ImageResizer.ThumbY = 100
If ImageSrc.PostedFile.Conten tLength <> 0 Then
IncomingFile = New IO.FileInfo(Request.Files( 0).FileNam e)
IncomingFile = New IO.FileInfo(Server.MapPath ("~/Pictur es/Product s/") & IncomingFile.Name)
Request.Files(0).SaveAs(In comingFile .FullName)
ImageSource = ImageResizer.ResizeImage(I ncomingFil e.FullName )
End If
Dim IncomingFile As IO.FileInfo
Dim ImageSource, PriceValue As String
Dim ImageResizer As New ResizeImage(True, 400, 300)
ImageResizer.ThumbX = 100
ImageResizer.ThumbY = 100
If ImageSrc.PostedFile.Conten
IncomingFile = New IO.FileInfo(Request.Files(
IncomingFile = New IO.FileInfo(Server.MapPath
Request.Files(0).SaveAs(In
ImageSource = ImageResizer.ResizeImage(I
End If
ASKER
AerosSaga... you rock! worked out of the box (almost) :-)
hehe thank you, thank you
Aeros
Aeros
Uploading, Determining Size, Width and Height and Resizing Image Files with ASP.NET
http://www.stardeveloper.com/articles/display.html?article=2003040501&page=1