2

Retrieve the bitmap from uri

 2 years ago
source link: https://www.codesd.com/item/retrieve-the-bitmap-from-uri.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Retrieve the bitmap from uri

advertisements

I have included 'share via myApp' option. I inserted following code in the receiving activity class.

    // Get the intent that started this activity
    Intent intent = getIntent();
    Uri data = intent.getData();

    // Figure out what to do based on the intent type
    if (intent.getType().indexOf("image/") != -1) {
        // Handle intents with image data ...
}

What is the next step to retrieve bitmap image.


As you have already get the Uri. Now you have to pass that Uri in getBitmap() to get bitmap and use that bitmap.

Uri imageUri = intent.getData();
Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(),imageUri);
Imageview my_img_view = (Imageview ) findViewById (R.id.my_img_view);
my_img_view.setImageBitmap(bitmap);

Related Articles

The parameter is an invalid exception when retrieving the image from the database to the image box

I am retrieving the image from a SQL Server database into a PictureBox in a C# Windows application. The image is a form which I don't know. I tried this code but it throws a "parameter invalid" exception, and I also go through many answer relate

Retrieve the URL from an Img Html tag

BackGround Info Currently working on a C# web api that will be returning selected Img url's as base64. I currently have the functionality that would preform the base64 conversion however, I am getting a large amount of text which also include Img Url

Ajax retrieves the value from the json object ()

This is my first ajax experience. I have successfully got the GET response from server using ajax. But I am facing problem to retrieve the value from the JSON. My ajax call: url: "ur", type: "GET", cache: false, dataType:"json&quo

Add & ldquo; Select & rdquo; To the drop-down list that retrieves the values ​​from the database

I have a drop-down list and uses the SQL data source for it where I am retrieving the product names from SQL server. Now, I want to add "Please Select a product" Option to the drop-down list. As far as my knowledge, I add options to drop-down li

Combobox Autosuggestion to retrieve the values ​​from the mysql database

Am using the following java program for Autosuggestion combobox with retrieve the values from mysql database.the Auto Suggestion working properly.If i type 'A' in the combobox means the list will show the all names starting with 'A'.i add the label i

How to store and retrieve the image from a hive table

I want to store image in hive table and then retrieve the image to display it on the dashboard. Can i do it without using any Java coding? I have successfully created hive table and loaded the image file in it in a column with a binary datatype but t

How do I get the bitmap from the canvas I receive onDraw?

How can I create the bitmap from the canvas of custom view.There is no way to extract the Bitmap out of a Canvas. The only way you can access it is to pass it yourself when creating the canvas like this new Canvas(myBitmap) and keep the reference. ED

Retrieving the value from a module.exports array of objects

I'm trying to retrieve the values from this module.export array and I just can't. Can you help me? This is words.js module.exports = { "word1": 'phrase1', "word2": 'phrase2', "word3": 'phrase3', "word4": 'phrase4',

How do I retrieve the value from a text box dynamically created using its ID in asp.net?

this is how i have added the dynamic textboxes in cells in a table in the form. and i want to retrieve the values from the textboxes using its id and store it in a string to generate a sql query For i As Integer = 1 To nov Dim tb As New TextBox() Dim

Retrieve the date from Firebase, angularJS

I'm using Firebase 2.0.4 and AngularFire 0.9.0. I'm having trouble retrieving a date from Firebase in an editor. First of all, let me show you how I saved it. I realize that Firebase won't take a date type, so I convert it to a string when pushing it

How do I retrieve the jsessionid from the URL in JSP?

I know how to pass the jsessionid to the URL. I encode the url, which will look like this: mysite.com;jsessionid=0123456789ABCDEF (http) Does there exist a built-in method to retrieve the jsessionid from the URL, using Java? I found this method in th

How to retrieve the values ​​from the list using linq query indexes?

I have a list of int that contains 5,6,7,8,5,4,3. I like to retrieve the value from list using their index. For example, I give start index as 1 and end index 4 I will get 6,7,8,5 in new list. How can I do this in Linq?Use Skip and Take: var results

how to pass the bitmap from one activity to another?

I have two activity , the first activity (camera Activity) contain two button one to open the camera , and the second activity display form contain the image view I need to pass the bitmap that capture from camera in another FORM activity ,the camera

Visualization of empty image when creating the file from Uri

Capturing image through Camera intent => new Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, photoUri); Converting Uri to string => String image = photoUri.toString(); Retrieving Uri from same string => Uri uri = Uri.par

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK