capture라는 이미지 버튼을 누르면 화면이 캡쳐되고 갤러리에 저장되게 하려고 하는데요
검색좀 해봤는데
캡쳐가 꼭 루트권한을 가지고 있어야 가능한가요??
ImageButton capture_button = (ImageButton) findViewById(R.id.capture);
capture_button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
this.getRootView().setDrawingCacheEnabled(true);
this.getRootView().buildDrawingCache();
Bitmap srcimg = this.getRootView().getDrawingCache();
try {
FileOutputStream out = new FileOutputStream(
"/sdcard/captureScreen.png");
srcimg.compress(Bitmap.CompressFormat.PNG, 100, out);
} catch (FileNotFoundException e) {
Log.d("FileNotFoundException:", e.getMessage());
}
}
private View getRootView() {
// TODO Auto-generated method stub
return null;
}
});
일단은 다른 분이 올려주신 소스를 가져와서 한번 해 봤는데 잘 안되네요
도움부탁드립니다.
프레임버퍼에 있는 내용 가져오는 것이라면 루트권한이 필요한것으로 알고 있습니다