韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha
绘制bitmap 全屏
- Rectf rectF = new RectF(0, 0, w, h); //w和h分别是屏幕的宽和高,也就是你想让图片显示的宽和高
- canvas.drawBitmap(bitmap, null, rectF, null);
安卓获取 屏幕大小
1
、WindowManager wm = (WindowManager) getContext()
.getSystemService(Context.WINDOW_SERVICE);
int
width = wm.getDefaultDisplay().getWidth();
int
height = wm.getDefaultDisplay().getHeight();
2
、WindowManager wm =
this
.getWindowManager();
int
width = wm.getDefaultDisplay().getWidth();
int
height = wm.getDefaultDisplay().getHeight();