android-image

Convert bitmap to sepia in android

你。 提交于 2019-11-27 12:55:07
Is there any way to convert a Bitmap to sepia? I know to convert to grayScale is to set the setSaturation in ColorMatrix. But what about Sepia? If you have instance of image then you can use ColorMartix to draw it in Sepia. Let me describe way how you can do this using Drawable. public static void setSepiaColorFilter(Drawable drawable) { if (drawable == null) return; final ColorMatrix matrixA = new ColorMatrix(); // making image B&W matrixA.setSaturation(0); final ColorMatrix matrixB = new ColorMatrix(); // applying scales for RGB color values matrixB.setScale(1f, .95f, .82f, 1.0f); matrixA

How to create a video preview in android?

只愿长相守 提交于 2019-11-27 10:57:31
问题 I have a video file in my sdcard. I would like to show a preview of this video in my ImageView . Please let me know how to do this in Android. Thank you for your help and time. 回答1: If you use API level 8 and above. You can create preview of a video like this: String videoFile = "/sdcard/blonde.mp4"; Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail(videoFile, MediaStore.Images.Thumbnails.MINI_KIND); Now you can show it in an ImageView : ImageView imageView = (ImageView) findViewById(R

Android Text over image

元气小坏坏 提交于 2019-11-27 10:28:56
I have an imageView with an image, over that image I want to place a text. How can I achieve that? Alesqui That is how I did it and it worked exactly as you asked for inside a RelativeLayout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativelayout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/myImageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/myImageSouce" /> <TextView android:id="@+id/myImageViewText" android:layout_width="wrap

Get Meta Data of Image - Android

◇◆丶佛笑我妖孽 提交于 2019-11-27 09:19:47
http://www.isco.com/webproductimages/appBnr/bnr1.jpg I've used a website to see the metadata of a image. In this website, it shows all info of image. I want to know how to get the "Title" tag of above image in android. I found here the similiar question for iOS only: How to get image metadata in ios However I don't know how to get "Meta data" of image on android. ExifInterface only gives some informations. But I'm unable to get "Title" tag with it. Can you provide any code snippet for get meta data in android for image? Venkatesh S Download metadata extractor from the link given here ......

android circular gallery?

家住魔仙堡 提交于 2019-11-27 08:09:33
I am a newbie to android development.Now i would like to do gallery view as circular like image as below.The things is that i want to enlarge the center image when user scroll from left to right and right to left. Is there any tutorials for that ? what I want is the image that's been swiped need to be enlarged while it's at the center. I thought I could do it with Gallery. but the example from the android developer is not the one I want. :( If you want to enlarge the center selected image there is one possible way. On your onItemSelected method, just call an animation to zoom the object. The

Set Imageview to show image in sdcard?

天涯浪子 提交于 2019-11-27 07:48:52
I have a image stored in SD card of my phone. I want to show it in a image view. I know the location of the file. On the oncreate of the activity is there a simple way to say something like ImageView img = (ImageView) findViewById(R.id.imageView1); String path = Environment.getExternalStorageDirectory().toString() "Images/image.jpg"; img.setsrc = path ; Please let me know if there is any way to do this. Thank you. Bitmap bmp = BitmapFactory.decodeFile(pathName); ImageView img; img.setImageBitmap(bmp); Hope this helps. I have this snippet that may help: File imageFile = new File("/sdcard

How to scale an image down in android

邮差的信 提交于 2019-11-27 06:38:30
问题 I am creating an android application and I can add an image. However, what I want to do is scale down the image to fit the ImageButton size. Is there any way to do that? The code I have written so far: package awad865.project.ContactManager1; import java.io.FileNotFoundException; import java.io.InputStream; import android.app.Activity; import android.content.Intent; import android.database.SQLException; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android

How to use images in Android SQLite that are larger than the limitations of a CursorWindow?

左心房为你撑大大i 提交于 2019-11-27 05:41:43
As per the question. Say I have an Image that is approx 3.5 MB in size, which could be saved as a blob, but couldn't be retrieved due to the 2Mb limitation of a CursorWindow? Note The question has been asked purely to show, contrary to responses saying that it cannot be done, that it can be done (albeit NOT RECOMMENDED ), as this is a It’s OK to Ask and Answer Your Own Questions . Note This is not recommended as it would still likely be quite inefficient in comparison to storing the path to an image file. The obvious answer is to split the image up into manageable parts (chunks) (say 256k

How to apply different image effects (filters) on bitmap like sepia, black and white, blur, etc.?

泄露秘密 提交于 2019-11-27 05:26:23
问题 I am not having any idea of how to apply different effect on Image, I have seen the EffectFactory class and Effect class in effect class there is one method apply but I am not sure what to pass in inputTexId and optputTexId, and from where I get the new updated image, how to store the updated image in imageView, Please help me with how to approach this problem. Is there any opensource library available for providing effects on Image. Thanks, 回答1: I have implemented Jerry's Java Image

How to use Universal Image Loader

心不动则不痛 提交于 2019-11-27 02:43:58
问题 I have a requirement where I need to load thumbnails and a Text in ListView which gets set by the custom Adapter . The Thumbnails should be stored in a cache memory, for that I am using the Universal Image Loader however I am pretty much confused in the implementation of it and how to use it as per my requirement in to load the images in ListView from URL . Please suggest me some ways for it with good implementation. 回答1: Write below code line into your adapter's getView() method, here