How to get the image format from Clipboard class?
问题 I'm making a image viewer in C#. that feature is copy and paste function using Clipboard class on C#. And I succeeded to get image of BitmapSource. but it can not check image formats (jpeg, png, bmp). This is supported source from C# BitmapSource source = Clipboard.GetImage(); These are what i want to use. byte[] image = Clipboard.GetImage("image/png") byte[] image = Clipboard.GetImage("image/bmp") I will say, How do I check image format from BitmapSource or Clipboard? 回答1: Simply put, you