public static Bitmap GetImage(string library, string id) { CouchDatabase db = GetDatabase(library); Stream stream = db.GetAttachmentStream(id, "image"); try { System.Drawing.Bitmap image = new System.Drawing.Bitmap(stream); return(Bitmap.FromSystemDrawingBitmap(image)); } catch (IOException e) { Console.Error.WriteLine(e.StackTrace); } return(null); }