android-bitmap

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

Create rectangle bitmap from trapezoid crop

强颜欢笑 提交于 2021-02-11 12:15:34
问题 I would like to convert the trapezoid section of the image denoted by points A,B,C,D to a rectangle bitmap. I am able to make the user mark the 4 points in the image, but I am not sure as to how can I convert the trapezoid to rectangle. Any input from the community is appreciate. 回答1: The implementation has been done. Thanks for @IcedLance too for the reference. This is for future reference and for the community. The entire implementation has been done. private Bitmap

Different capture output size on certain camera resolutions in Android

北城余情 提交于 2021-02-08 23:43:55
问题 I am developing a custom camera application using the Android Camera2 API where you can switch between the different camera and video resolutions available in the phone. It also offers the possibility to take squared 1:1 pictures. To take the square pictures, I take a normal 4:3 picture and then crop it to maintain the 1:1. (So 4032x3024 would be 3024x3024). I noticed a problem when taking a 1:1 picture on certain resolutions, the output is slightly cropped (zoomed). This is the result of the

How to show database image in Glide on Android?

风格不统一 提交于 2021-02-08 05:16:54
问题 I have a SqliteDatabase in my application. In this database, I save Sting and Blob(for save image) . This image is saved in application with byte[ ] . I convert this image to Bitmap with the help of following code: byte[] Recycler_imageByte; Bitmap Recycler_theImage; holder.Recycler_imageByte = data.get(position).getKey_image(); ByteArrayInputStream imageStream = new ByteArrayInputStream(holder.Recycler_imageByte); holder.Recycler_theImage = BitmapFactory.decodeStream(imageStream); I want to

How to show database image in Glide on Android?

断了今生、忘了曾经 提交于 2021-02-08 05:16:33
问题 I have a SqliteDatabase in my application. In this database, I save Sting and Blob(for save image) . This image is saved in application with byte[ ] . I convert this image to Bitmap with the help of following code: byte[] Recycler_imageByte; Bitmap Recycler_theImage; holder.Recycler_imageByte = data.get(position).getKey_image(); ByteArrayInputStream imageStream = new ByteArrayInputStream(holder.Recycler_imageByte); holder.Recycler_theImage = BitmapFactory.decodeStream(imageStream); I want to

Unable to decode stream: java.io.FileNotFoundException (Permission denied) [duplicate]

北城余情 提交于 2021-01-29 15:43:22
问题 This question already has answers here : Getting the Absolute File Path from Content URI for searched images (2 answers) Closed 2 years ago . I am trying to upload multiple images from gallery at once. given here. The issue i am facing is converting the string to bitmap. I got the following error. E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Screenshots/Screenshot_2018-11-05-14-59-33-023_com.android.mms.png (Permission denied) The error

Get Bitmap using a Target in Picasso

情到浓时终转凉″ 提交于 2020-12-31 15:38:56
问题 I'm working on movies Android app which get list of movies from an API which provides a poster path for all movies. I want to get the image as Bitmap from the image's URL to save it as a Bitmap variable in the model class. I want to save the image as blob in the DB to retrieve it directly without redownloading it each time the user opens the app. Is that possible? I want to do something like this, but it always returns null. private Bitmap posterBitmap; public void setPosterBitmap () {

Get Bitmap using a Target in Picasso

强颜欢笑 提交于 2020-12-31 15:34:40
问题 I'm working on movies Android app which get list of movies from an API which provides a poster path for all movies. I want to get the image as Bitmap from the image's URL to save it as a Bitmap variable in the model class. I want to save the image as blob in the DB to retrieve it directly without redownloading it each time the user opens the app. Is that possible? I want to do something like this, but it always returns null. private Bitmap posterBitmap; public void setPosterBitmap () {

Get Bitmap using a Target in Picasso

折月煮酒 提交于 2020-12-31 15:33:16
问题 I'm working on movies Android app which get list of movies from an API which provides a poster path for all movies. I want to get the image as Bitmap from the image's URL to save it as a Bitmap variable in the model class. I want to save the image as blob in the DB to retrieve it directly without redownloading it each time the user opens the app. Is that possible? I want to do something like this, but it always returns null. private Bitmap posterBitmap; public void setPosterBitmap () {

Get Bitmap using a Target in Picasso

泄露秘密 提交于 2020-12-31 15:29:23
问题 I'm working on movies Android app which get list of movies from an API which provides a poster path for all movies. I want to get the image as Bitmap from the image's URL to save it as a Bitmap variable in the model class. I want to save the image as blob in the DB to retrieve it directly without redownloading it each time the user opens the app. Is that possible? I want to do something like this, but it always returns null. private Bitmap posterBitmap; public void setPosterBitmap () {