Resizing Images RRS feed

  • Question

  • User-1858836523 posted
    I'm allowing my users to upload .jpgs/.gifs onto my server. How is it possible that I could resize all images to say 100x100px before storing it onto the server?
    Tuesday, February 1, 2005 12:58 AM

All replies

  • User-1858836523 posted
    Anyone on this? or are there some references I could consider?
    Sunday, February 6, 2005 8:49 PM
  • User88235362 posted
    If you want some ready made code to automatically thumbnail images for you the code associated with the article http://www.codeproject.com/useritems/colorwash.asp has some bonus functionality to do this for you via the "ImposeUpperLimitOnDimensions" method of the GavDev.Image.Manipulate class library. The article itself is aimed at applying a color wash to images, but the bonus functionality is mentioned very breifly at the bottom of the article and works very well. The code mentioned is used by the following sites: http://www.tours2travel.com http://www.fisbo.co.uk http://www.itag.co.nz So it's proved and tested ;-)
    Saturday, March 5, 2005 8:38 AM
  • User-35480730 posted
    You need to create a new bitmap with size you want (not image, you cannot set size of image), then you must create a graphic and fill it with system.drawing.graphics.fromimage function with you new created bitmap, then use of your new graphic object function drawimage, setting your original image there, so you got a new bitmap of size you want with you original image resized. Then you can convert this bitmap to image, or save it or do anything you want VB: 1. New mybitmap as system.drawing.bitmap = new bitmap(x,y) 2 .new mygraph as system.drawing.graphics= system.drawing.graphics.fromimage(mybitmap) 3. mygraph.drawimage(mysourceimage) mybitmap - is your resized picture of mysourceimage
    Friday, March 11, 2005 5:08 PM