Resizing image on the fly with ASP.NET using the System.Drawing namespace
Posted by Daniel - 2,324 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
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
Popular Entries
- Passing arguments to your VB.NET console application
- Microsoft Excel Import External Data Problem: When Microsoft Query doesn’t recognize some of your parameters
- Resize Image or Crop Image with Joe Lencioni’s Smart Image Resizer, WordPress Setup
- How to Get User Input and allowing more than 256 characters to be entered on .NET Console Application
- ASCII To PDU Converter (Convert ASCII to PDU and vice versa)
- ConsoleProgressBar - Simple Progress Bar Function for your VB.Net Console Application
- An example: Using CPort Delphi Component to read data from your cellphone
- Runtime-Form-Creation. Automatically creating child forms in a Delphi MDI application with a component array
- CPort Component (Serial port interface component for Delphi)
- SmartImageResizer Plugin, WordPress plugin based on Joe Lencioni’s Smart Image Resizer













