/* TODO 현제 화면을 Bitmap을 그려주는 함수 */
public Bitmap takeScreenshot() {
View rootView = findViewById(android.R.id.content).getRootView();
rootView.setDrawingCacheEnabled(true);
return rootView.getDrawingCache(); }
/* TODO Bitmap을 이미지 파일로 저장해주는 함수 */
public String SaveBitmapToFile(Bitmap bitmap, String strfilepath, String filename) {
/* */
File imagePath = new File(strfilepath);
if(!imagePath.exists()) { imagePath.mkdirs(); }
File fileCacheItem = new File(strfilepath + filename);
String path = fileCacheItem.getAbsolutePath(); /* 해당 파일이 저장 되어 있는 경로를 저장 */
OutputStream out = null;
try { /* 정상적으로 저장이 되었을 경우 */
fileCacheItem.createNewFile();
out = new FileOutputStream(fileCacheItem);
bitmap.compress(CompressFormat.JPEG, 100, out);
Toast.makeText(getApplicationContext(), "저장이 되었습니다.", Toast.LENGTH_SHORT).show(); return path;
}
catch (FileNotFoundException e) { Log.e("GREC", e.getMessage()); return null; }
catch (IOException e) { Log.e("GREC", e.getMessage()); return null; }
}
안녕하세요?
현제 화면을 찍는 부분을 적용 하였는데요.
그런데 보니깐 상태바가 하얀색으로 비어서 찍히 더라구요...
상태바를 안 찍히게 하려면 상태바를 숨겨야 하나요??? 상태바 숨길려면 어떻게 해야하는지 궁금합니다.