Created
November 5, 2012 17:55
-
-
Save manadart/4019179 to your computer and use it in GitHub Desktop.
MonoDroid Screen Size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Method One. | |
var disp = WindowManager.DefaultDisplay; | |
var height = disp.Height; | |
var width = disp.Width; | |
Console.WriteLine("Default Display: {0}x{1}", width, height); | |
// Method Two. | |
var met = new DisplayMetrics(); | |
disp.GetMetrics(met); | |
var heightm = met.HeightPixels; | |
var widthm = met.WidthPixels; | |
Console.WriteLine("Metrics: {0}x{1}", widthm, heightm); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment