android-imageview

Android Convert current screen to bitmap

一笑奈何 提交于 2021-02-15 06:01:15
问题 I would like to convert a screen of my app and convert it into a Bitmap. I already know how to convert a view into a bitmap, but that's not what I want as my screen is made up of many fragments. Thus I'd like to be able to take the screen and convert it into a bitmap... Help is highly appreciated thanks. 回答1: You could use something like this and pass the layout as a view ;) public Bitmap takeScreenShot(View view) { // configuramos para que la view almacene la cache en una imagen view

Svg not visible in device but visible in android xml

前提是你 提交于 2021-02-10 05:03:04
问题 I have used SVG's for these icons, the icons are visible in xml but not visible in device . following is my code : ` <LinearLayout android:layout_width="match_parent" android:layout_height="40dp" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:gravity="center" android:orientation="horizontal" android:weightSum="10" > <ImageView android:layout_width="0dp" android:layout_height="25dp" android:layout_weight="1.5" app

Android ImageView not loaded

孤人 提交于 2021-02-08 13:01:10
问题 I am using the android imageView and I put the the image into the drawable folder, and changed the imageView source to that image. But it does not show the image in the Preview panel and when I open the picture in the android studio,it show the error like this. But I can open the picture on my computer desktop. so why there is the error and how to solve it? 回答1: Sounds like piac.png was not a .png file, you just slapped a .png extension on it and expected it to become a .png file. The problem

How to crop the image using four (x,y) coordinates

纵饮孤独 提交于 2021-02-04 05:00:11
问题 In my application ,I am going to crop the image using four (x,y) coordinates and also I need to show the cropped image in another activity screen. For example, In the below image, i want to crop the white layer itself. so any one provide the solution to accomplish this technique in my project. 回答1: Using an instance of the Bitmap class, you can use the Bitmap.creatBitmap(); method passing the original image x y (for the top left corner) and then width and height. see documentation here. in

Android Picasso image loading app crash when scrolling RecyclerView

对着背影说爱祢 提交于 2021-01-29 02:44:41
问题 I am using Retrofit to access this Webservice link: https://jsonplaceholder.typicode.com/photos When loading the items in a recyclerview without loading images, the app works fine. However, if I add Picasso code to load the images, the app crashes after scrolling 2 or three times. I get the following error: A/Looper: Could not make wake event fd: Too many open files OR these errors all together: E/Parcel: fcntl(F_DUPFD_CLOEXEC) failed in Parcel::read, i is 0, fds[i] is -1, fd_count is 1,

How to hold the selected image in GridView and pass to next activity after I click Button

天涯浪子 提交于 2020-08-20 06:50:30
问题 In my Activity I have an EditText , a Button and a GridView . The user selects the image from the GridView and enters the name in the EditText , and then clicks the done button. activity.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" android:id="@+id/l1" > <View android:layout