Image in DataGridView
-
Hi all, I have created a form with a datagridview. I created a new Class called duplicate Picture that has 4 fields. 2 type String both hold filepaths. 2 type Bitmap that "should" hold the picture at the path set above. My constructor sets the Bitmap to be the paths as specified. I look through a file structure and find duplicate images, add them to a List of the class described above, then using CurrencyManager show a list of the path on the DataGridview as well as the image. I kept getting the little White Square with a red cross in it for the Bitmaps. So I changed the Properties for the Bitmaps to return a Image class instead, and converted the Bitmap to a Thumbnail, but that just caused more problems. Am I missing something fundamental here? Original Class I created -
sing System; using System.Collections.Generic; using System.Text; using System.Drawing; namespace DuplicateFile { class DuplicateFile { private string _shortName; private string _originalFilePath; private String _duplicateFilePath; private Bitmap _originalPicture; private Bitmap _duplicatePicture; public DuplicateFile(string newShortName, string newOriginalFilePath, string newDuplicateFilePath) { shortName = newShortName; originalFilePath = newOriginalFilePath; duplicateFilePath = newDuplicateFilePath; } public string shortName { get { return this._shortName; } set { this._shortName = value; } } public string originalFilePath { get { return this._originalFilePath; } set { this._originalFilePath = value; Bitmap originalPicture = new Bitmap(originalFilePath); } } public string duplicateFilePath { get { return this._duplicateFilePath; } set { this._duplicateFilePath = value; Bitmap duplicatePicture = new Bitmap(duplicateFilePath); } } public Bitmap duplicatePicture { get { return _duplicatePicture; }