locked
Resize Image RRS feed

  • Question

  • User448619955 posted

    Hi there I want to resize my image and save it by fileupload in my path.

    I found this code:

    public static System.Drawing.Image ResizeImage(System.Drawing.Image sourceImage, int width, int height)
    
    {
    
        System.Drawing.Image oThumbNail = new Bitmap(sourceImage, width, height);
    
        Graphics oGraphic = Graphics.FromImage(oThumbNail);
    
        oGraphic.CompositingQuality = CompositingQuality.HighQuality;
    
        oGraphic.SmoothingMode = SmoothingMode.HighQuality;
    
        oGraphic.InterpolationMode = InterpolationMode.HighQualityBicubic;
    
        Rectangle oRectangle = new Rectangle(0, 0, width, height);
    
        oGraphic.DrawImage(sourceImage, oRectangle);
    
        return oThumbNail;
    
    }
     now how can I show this image?
    like Image1.....=ResizeImage(....)
    what should i write?
    ResizeImageResizeImage
    Sunday, January 15, 2012 5:33 AM

All replies