Get video resolution on Mac via .NET
I can get informations about video-files like resolution by using the Shell32.dll under windows.
Is there some way t开发者_StackOverflow社区o do this (in C# - running under the mono framework) that will work on Mac?
Since the question is unclear to me, here are two part answer:
1. if you want to check the resolution of your screen (desktop):
Check if this is implemented: System.Windows.Forms.Screen.AllScreens
.
For now, there is some code for it but it's marked with [MonoTODO] attribute.
AllScreens
: http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.allscreens.aspx
Source for the library: http://www.java2s.com/Open-Source/CSharp/2.6.4-mono-.net-core/System.Windows.Forms/System/Windows/Forms/Screen.cs.htm
2. if you want to check video file resolution
For that, I would seek ffmpeg
built for Mac and using command line parameters extract resolution information from the file.
http://jungels.net/articles/ffmpeg-howto.html
Use MonoMac and look at MonoMac.AppKit.NSScreen. It should have all the properties you need to retrieve the resolution of any (if multiple) screen(s).
If you need more documentation or samples you simply have to browser Apple doc on NSScreen. The properties names will closely match what MonoMac provides.
精彩评论