An explanation of the Android screenshot

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.