using System.Drawing; Image img = Image.FromFile(@"C:\myimage.jpg");
using System.Drawing; Image img = Image.FromFile(@"C:\myimage.jpg"); Image thumbnail = new Bitmap(100, 100); using (Graphics g = Graphics.FromImage(thumbnail)) { g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(img, 0, 0, 100, 100); }
using System.Drawing; using System.Drawing.Imaging; Image img = Image.FromFile(@"C:\myimage.jpg"); img.Save(@"C:\myimage.png", ImageFormat.Png);This code snippet loads an image file named "myimage.jpg" from the local disk, and saves it to disk in PNG file format as "myimage.png". The System.Drawing namespace is a part of the .NET Framework and is included in the standard library that comes with the .NET Framework.