I'm trying to open an image in C# based on user defined strings. What I have is the main program which asks the following from the user.
Console.WriteLine("Please input the type of genre you wish to test: Western, Action, Thriller or Comedy");
inputGenre = Console.ReadLine();
List<string> resultantShots = Film.outputShots(inputGenre, trainFilms);
Console.WriteLine("Final shot sequence should therefore follow this guideline: ");
resultantShots.ForEach(Console.WriteLine);
Film.imageOutput(inputGenre, resultantShots[0]);
This will ask the user to input a specific string, then generate a list of strings afterwards in a static function (which already works and generates the output I want) The final line points to another static function which currently looks like this:
public static void imageOutput(string genre, string shot)
{
bool contains = Directory.EnumerateFiles(genre).Any(f => f.Contains(shot));
if (contains)
{
Console.WriteLine("Genre found");
}
}
This function will take the user input string, check if the string matches the name of a folder in the directory "bin/Debug/net 6.0" and then afterwards check if a film contains the string. My current issue is this: In each folder I have images that will match a string from the resultant shot list. For example, the resultant shot might be a string "Medium Full" and I have a png image called Medium Full. I'm just unsure however, on how I open this image in the console itself. Equally, I want to only open images that exactly match the string itself. If the string for instance is "Medium Full" I don't want my program to open an image labelled "medium".
I've never really worked with images before in C#, so if anyone has any advice it would be appreciated.