Open GoogleCodeExporter opened 9 years ago
specifically, u can't call "getWindowManager().getDefaultDisplay().getWidth();"
Original comment by davidtia...@gmail.com
on 9 Jan 2013 at 7:14
Doesnt show me any error on :
int frameBufferWidth = isLandscape ? 480 : 320;
int frameBufferHeight = isLandscape ? 320 : 480;
Bitmap frameBuffer = Bitmap.createBitmap(frameBufferWidth,
frameBufferHeight, Config.RGB_565);
It only says :
float scaleX = (float) frameBufferWidth
/ getWindowManager().getDefaultDisplay().getWidth();
float scaleY = (float) frameBufferHeight
/ getWindowManager().getDefaultDisplay().getHeight();
getWidth and getHeight are depracated so i added this:
float scaleX;
float scaleY;
if(Build.VERSION.SDK_INT < 13){
scaleX = (float) frameBufferWidth
/ getWindowManager().getDefaultDisplay().getWidth();
scaleY = (float) frameBufferHeight
/ getWindowManager().getDefaultDisplay().getHeight();
}
else{
Point screenSize = new Point();
scaleX = (float) frameBufferWidth
/ screenSize.x;
scaleY = (float) frameBufferHeight
/ screenSize.y;
}
It seems to work for me .
Original comment by skenderi...@gmail.com
on 3 Mar 2015 at 5:05
Original issue reported on code.google.com by
davidtia...@gmail.com
on 9 Jan 2013 at 7:13