CSharp examples for System.Drawing:Bitmap
Loads a bitmap from file.
using System.IO;/* www.j a va2 s. co m*/ using System.Drawing; public class Main{ /// <summary> /// Loads a bitmap from file. /// </summary> public static Bitmap Load(string path, string filename) { try { if (!string.IsNullOrEmpty(filename)) { var fullPath = Path.Combine(path, filename); if (File.Exists(fullPath)) { return new Bitmap(Bitmap.FromFile(fullPath)); } } return null; } catch { return null; } } }