如何获得屏幕尺寸的大小在Android的画布?
问题描述:
我能够得到正常活动的屏幕尺寸,但我需要在画布视图和放大器屏幕尺寸;按照操作与it.Any片段上这将是helpful.Thanks。
I am able to get the screen size in the normal activity but I need to get the screen size in a canvas view & manipulate in accordance with it.Any snippet on it will be helpful.Thanks.
答
我得到widthPixels heightPixels使用荷兰国际集团这一点。
i got widthPixels heightPixels use ing this.
DisplayMetrics metrics = getBaseContext().getResources().getDisplayMetrics();
int w = metrics.widthPixels;
int h = metrics.heightPixels;