Android抓取屏幕展示 內容(類似屏幕截圖)
/** * 更新相冊某個文件 */
public static void photoUpdates(Context context, File file) { if (!file.exists()) { return; } try { MediaStore.Images.Media.insertImage(context.getContentResolver(), file.getAbsolutePath(), file.getName(), null); } catch (FileNotFoundException e) { e.printStackTrace(); } Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); intent.setData(Uri.fromFile(file)); context.sendBroadcast(intent); }
/**獲取view 緩存(例如屏幕截屏,root layout )*/
public static Bitmap getViewCacheBitMap(View view) { view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bitmap = view.getDrawingCache(); return bitmap; }
本文由用戶 flkt9867 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!