I'm unsure about the right method to define some rules for a specific image in one of my user resource folders. I allow one image in this folder with a specific name, but this single image can be a PNG / JPEG / BMP.
What could be a suitable route for loading the image as BackgroundImage, when the current code setup for loading the image would be something like this:
private void Form1_DragDrop(object sender, DragEventArgs e)
{
var data = e.Data.GetData(DataFormats.FileDrop);
if (data != null)
{
var fileNames = data as string[];
if (fileNames.Length > 0)
BackgroundImage = Image.FromFile(fileNames[0]);
BackgroundImage = Image.FromFile(@"image_default\image_default.jpg");
}