TheUnknown
New Member
I want to upload an image and resize it while keeping its aspect ratio, then save it to the server. I would prefer that it makes the width of the image 200px. That way the image will fill the picturebox from left to right. I am unsure how to accomplish that. Right now I am using a FileUpload control. The image gets uploaded to a stream, converted, and I want it to save to the filesystem. I know I'm doing something wrong here.\[code\]string type = FileUpload1.PostedFile.ContentType;byte[] snap = new byte[FileUpload1.PostedFile.ContentLength];System.IO.Stream stream = FileUpload1.FileContent;System.Drawing.Image imageLarge = System.Drawing.Image.FromStream(stream);System.Drawing.Image imageLarge1 = ResizeImage(imageLarge, 200, 300);MemoryStream memolarge = new MemoryStream();imageLarge1.Save(memolarge, System.Drawing.Imaging.ImageFormat.Jpeg);System.Drawing.Image returnImage = System.Drawing.Image.FromStream(memolarge);\[/code\]