3

How do I find out the screen resolution of my Linux desktop from a C# program running in Mono? I am using Ubuntu.

Using the xrandr command I can view the resolution, but is there a programmatic way to get the same information?

2 Answers2

-1

Exactly the same way you would in .NET C#. That's the whole idea of Mono - for the underlying OS to be transparent.

Google "screen resolution C#". Your first search result should work just fine.

IneQuation
  • 1,244
  • 11
  • 27
  • 1
    "Search Google" is *never* a good answer. You would have been better off searching Google yourself and giving that link with some explanatory text. – paxdiablo Jun 23 '16 at 06:27
  • @paxdiablo: With that kind of attitude I would have been better off not responding at all. I have explained the key concept, which is that Mono/.NET abstracts platform differences away, and from there OP should be perfectly capable of dealing with this problem on their own. I disagree with the sentiment that SO is a place only for spoon-fed, ready-made answers. – IneQuation Jun 23 '16 at 06:52
  • You may well be right in that no answer would have been better. I had no "attitude" in commenting, just pointing out the deficiencies as I saw them. Since part of the intent of SO is to *be* the go-to place for programming questions from search engines, answers directing people to search engines are less than useful. In addition, telling OP to just go to the first link is useless when such link could easily change. And I never stated SO was for spoon-feeding but it *is* meant to be for ready made answers. But we've both made our points, it's up to the swarm. – paxdiablo Jun 23 '16 at 09:31
-2

You can use following command:

xdpyinfo  | grep 'dimensions:'
linuxexplore
  • 409
  • 3
  • 7