문제

I can get informations about video-files like resolution by using the Shell32.dll under windows.

Is there some way to 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top