The Android screen features are implemented here in two ways:
The first way to intercept the entire screen implementation of three kinds
ImageView IMGV = (ImageView) Findviewbyid (r.id.imageview01);
ImageView imgV2 = (ImageView) Findviewbyid (r.id.imageview02);
ImageView imgV3 = (ImageView) Findviewbyid (r.id.imageview03);
//draw the whole screen, but the status bar is black, but you can use the Translate method of the canvas according to the state
//Bar height adjustment
View CV = GetWindow (). Getdecorview ();
Bitmap B = Bitmap.createbitmap (n, a, Bitmap.Config.RGB_565);
Cv.draw (New Canvas (b));
Iv.setimagebitmap (b);
//For hidden non-drawn controls, the cut-out is black
Bitmap image = Bitmap.createbitmap (n, a, Bitmap.Config.RGB_565);
CV. Draw (new Canvas (image));
imgV2. Setimagebitmap (image);
//can also be obtained via Getdrawingcache
CV. setdrawingcacheenabled (true);
Bitmap Bitmap =cv. Getdrawingcache ();
drawable drawable = (drawable) new bitmapdrawable (bitmap);
imgV3. setbackgrounddrawable (drawable);
The second interception of the current layout view is saved as a picture
Android Screen detailed