using System; using System.Collections.Generic; using System.Text; using System.Drawing; namespace ResizeImage { class ResizeImage { public static Bitmap Resize(string Img, int porCiento) { Bitmap image = (Bitmap)Bitmap.FromFile(Img); float nPercent = ((float)porCiento / 100); int destinoWidth = (int)(image.Width * nPercent); int destinoHeight = (int)(image.Height * nPercent); //Bitmap image2 = ResizeBitmap(image, destinoWidth, destinoHeight); Bitmap Imagen2 = new Bitmap(destinoWidth, destinoHeight); using (Graphics g = Graphics.FromImage((Image)Imagen2)) { g.DrawImage(image, 0, 0, destinoWidth, destinoHeight); } image.Dispose(); return (Imagen2); } } }