Determine if file copied into clipboard is an image

后端 未结 3 1931
时光说笑
时光说笑 2021-01-05 08:58

The user right clicks on a file(say on the desktop) and clicks \'copy\' . Now how do I determine in C# if the file copied to the clipboard is an image type ?

Clipbo

3条回答
  •  独厮守ぢ
    2021-01-05 09:20

    You can easily check the clipboard if contains image or not:

    if (Clipboard.ContainsImage())
    {
        MessageBox.Show("Yes this is an image.");
    }
    else
    {
        MessageBox.Show("No this is not an image!");
    }
    

提交回复
热议问题