Talking about Android getting pictures on ImageView and a possible problem
1. Call setdrawingcacheenabled (true) before obtaining the picture:
Example: mimageview.setdrawingcacheenabled (true);
2. After that, you can get the picture through getdrawingcache()
Example: bitmap obmp = bitmap. Createbitmap (mimageview. Getdrawingcache())// Get the image of bitmap
3. Remember to call setdrawingcacheenabled (false) after getting the picture
Example: mimageview.setdrawingcacheenabled (false);
That's it.
Add: if you encounter this line of code, bitmap obmp = bitmap. Createbitmap (mimageview. Getdrawingcache()); Null pointer error!!!!!!
terms of settlement:
Before that, add the following code
The above article discusses how Android obtains the pictures on ImageView, and a possible problem is that Xiaobian has shared all the contents with you. I hope it can give you a reference and support more programming tips.