Perhaps you can do this with Metadata - but I'm not familiar with this subject so I'm not completely sure it's possible, nor do I how to do it.
What I do suggest is make a type.
So for example you can create a class which will have a Bitmap(1) property for the image, and a string for the file's path.
class LocalBitmap
{
public Bitmap Bitmap { get; set; }
public String Path { get; set; }
public LocalBitmap(String path)
{
Path = path;
Bitmap = new Bitmap(path);
}
}
And use it like so:
LocalBitmapimage = new LocalBitmap(@"C:\myImage.bmp");
(1) Consider using the
Image class instead. It's the base class of
Bitmap. If you're not sure which one to use ask yourself if your class requires an image or an image of that exact format (that is, bitmap).