Resizing image on the fly with ASP.NET using the System.Drawing namespace
Posted by Daniel - 884 Views
Resizing image on the fly with the tradional ASP script is impossible without an external component. But with the release of the .NET Framework, resizing image on the fly has become an easy process.
The System.Drawing namespace provides all the functionalities to do that. Lets get to the point. Following is an example of a sub procedure to resize image and then save it to the specified path:
Dim objOriginalImage as System.Drawing.Image
Dim objResizedImage as Bitmap
Dim imageFormat as Imaging.ImageFormat
objOriginalImage = System.Drawing.Image.FromFile(strSourcePath)
imageFormat = objOriginalImage.RawFormat
objResizedImage = New Bitmap(objOriginalImage, intWidth, intHeight)
objResizedImage.Save(strSavePath,imageFormat)
End Sub
Just in case you’re curious about how it works, the full code is included with this article, you can download it by clicking here (81 KB)
The following posts are programmatically considered as related to the current post by YARPP Plugin:
- Resize Image or Crop Image with Joe Lencioni’s Smart Image Resizer, WordPress Setup
- SimpleGridBuilder (ASP class definition)
- SmartImageResizer Plugin, WordPress plugin based on Joe Lencioni’s Smart Image Resizer
- Creating your own class definition with the traditional ASP
- Replacing and filtering text with regular expression using Delphi, Visual Basic and ASP
Leave a Reply
Hi, my name is Daniel Nugraha, a single male live on an island called Java, Indonesia. This is the place for me to share my interest in computer programming.
-
Get my Full Feed Here
Comments - Thanks Guys :)
Rangga Kusuma: Gan, Tengkiu buat postingan yang sangat berguna. Kebetulan ada project utk bikin sms gateway, dan converter Agan sangat berguna utk...
Chuck Norton: I actually went ahead & bolted over to Justin’s Get The Image plugin here: http://justintadlock.com/ar...
Chuck Norton: Question: is it possible to insert something like [custfieldimg=”joice1.jpg,15 0,1:1″] into the actual templates instead of...
Therese Lachance: Hi, Any idea how to have ContuttoPDF fetch the correct page language?
tresloukadu: yo how did u fixed when the tags shows <? and it shows < “& l t ; ” ?? please send me an email.













