I have this code that resizes an image to 300x300. But after resizing it, the image still loses its quality. i've tried other solutions posted on other websites that have the same code implementation to this code but it doesn't work for me. please help me with this.
Stream ream = FileUploadPic.FileContent;
System.Drawing.Image i = new Bitmap(ream);
Bitmap Orig_Photo = new Bitmap(i);
Bitmap resize_Photo = new Bitmap(300,300);
Graphics thumbnailGraph = Graphics.FromImage(resize_Photo);
thumbnailGraph.CompositingQuality = CompositingQuality.HighQuality;
thumbnailGraph.SmoothingMode = SmoothingMode.AntiAlias;
thumbnailGraph.InterpolationMode = InterpolationMode.HighQualityBicubic;
thumbnailGraph.PixelOffsetMode = PixelOffsetMode.HighQuality;
var imageRectangle = new Rectangle(0, 0, 300, 300);
thumbnailGraph.DrawImage(i, imageRectangle);
System.Drawing.Image ii = new Bitmap(resize_Photo);