Я решил это следующим образом ( Вам нужен пакет MetadataExtractor )
// access the date time
var subIfdDirectory = directories.OfType<ExifSubIfdDirectory>().FirstOrDefault();
var dateTime = subIfdDirectory?.GetDateTime(ExifDirectoryBase.TagDateTime);
//TEST
// print out all metadata
listBox2.Items.Clear();
foreach (var directory in directories)
{
foreach (var tag in directory.Tags)
listBox2.Items.Add($"{tag.Description}"); //Import just Information
}
, затем я добавил таймер таймер получает информацию из ListBox . Таймер работает с индикатором прогресса вместе, чтобы вывести информацию.
private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Increment(1);
if(progressBar1.Value == 1)
{
listBox2.SelectedIndex = 20;
InfoLabel.Text += " Größe: " + listBox2.SelectedItem.ToString();
}
else if (progressBar1.Value == 2)
{
listBox2.SelectedIndex = 18;
InfoLabel.Text += " Format: " + listBox2.SelectedItem.ToString();
}
else if(progressBar1.Value == 3)
{
Bitmap img = new Bitmap(listBox1.SelectedItem.ToString());
var imageHeight = img.Height;
var imageWidth = img.Width;
listBox2.SelectedIndex = 3;
InfoLabel.Text += " Abmessung: " + img.Width + " x " + img.Height;
}
else if (progressBar1.Value == 4)
{
listBox2.SelectedIndex = 3;
InfoLabel.Text += " Breite: " + listBox2.SelectedItem.ToString();
}
else if(progressBar1.Value == 5)
{
listBox2.SelectedIndex = 2;
InfoLabel.Text += " Höhe: " + listBox2.SelectedItem.ToString();
}
else if(progressBar1.Value == 6)
{
listBox2.SelectedIndex = 19;
InfoLabel.Text += " Dateiname: " + listBox2.SelectedItem.ToString();
}
else
{
timer1.Stop();
}
}
Поскольку для меня это слишком сложно, получите каждую информацию в другом ярлыке, я просто использовал один ярлык и просто добавил текст каждый раз.