Ok I need to load large images up to 30Meg (PNG) and manipulate them when I use the following code I get an Out Of Memory Exception.
Anyone have any sample code for loading a large file via stream maybe?
Code://Now load the image back in and grab the size. Image FullSizeImage = Image.FromFile(path + "\\high\\" + curPub.Image); //Error Here int width = FullSizeImage.Width; int height = FullSizeImage.Height; //Generate the thumb first. float ratio = width / 75; int thumbWidth = 75; int thumbHeight = Convert.ToInt32(height / ratio); Image ThumbnailImage = FullSizeImage.GetThumbnailImage(thumbWidth, thumbHeight, null, IntPtr.Zero); ThumbnailImage.Save(path + "\\images\\thumbnail\\" + curPub.Image, System.Drawing.Imaging.ImageFormat.Png);




Reply With Quote