[问题] 图片的中心点座标

楼主: iphone5566s (哀凤最终款)   2015-12-18 15:20:45
各位先进好~
我以此方式来进行拍摄获得相片
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 1);
接着来找出照片的中心点
protected void onActivityResult(int requestCode, int resultCode, Intent
intent) {
super.onActivityResult(requestCode, resultCode, intent);
Bitmap picture;
picture = (Bitmap) intent.getExtras().get("data");
cpic = picture.copy(Bitmap.Config.ARGB_8888, true);
int[][] imRed =new int[picture.getWidth()][picture.getHeight()];
int[][] imGreen =new int[picture.getWidth()][picture.getHeight()];
int[][] imBlue =new int[picture.getWidth()][picture.getHeight()];
br=imRed[picture.getWidth()/2][picture.getHeight()/2];
bg=imRed[picture.getWidth()/2][picture.getHeight()/2];
bb=imRed[picture.getWidth()/2][picture.getHeight()/2];
这时候我得到的RGB却不是照片的中间
而是在中间偏左下的位置
请问我那里想错了吗?
谢谢!!!
作者: MrJerome (飘扬)   2015-12-18 21:08:00
该图片宽跟高分别是多少pixel?以及x y cellsize分别是多少?
作者: howdye (\@o@/)   2015-12-18 22:09:00
拍出来的图是ARGB_8888吗? 会不会只有RGB
楼主: iphone5566s (哀凤最终款)   2015-12-21 10:02:00
解决了,应该只是设备不好造成画面延迟罢了..谢谢各位!!

Links booklink

Contact Us: admin [ a t ] ucptt.com