android-image

Implementing a multicolumn ListView with independent Row-heights

左心房为你撑大大i 提交于 2019-11-30 07:16:26
I would like to create a list of about 200 ImageViews (random heights) with the following layout in a 'collage' fashion: Normally I would do this in a ListView for the peformance gained by using Adapters but since i want the images to be displayed in columns, and with different height (See picture Example ) depending on the pictures, I cannot use a single listview for this purpose. I have tried implementing this layout with: Three ListViews with synchronized scrolling = Slow Single ListView with each row containing three images = Not allowing different heights GridView = Not allowing different

Loading large images without OutOfMemoryError

血红的双手。 提交于 2019-11-30 07:07:04
问题 I have a 5000 x 4000 px image which I want to draw onto a canvas. First I tried to load it from resources. I put it in /res/drawable . I used the following method: InputStream input = getResources().openRawResource(R.drawable.huge_image); Drawable d = Drawable.createFromStream(input, "image"); d.setBounds(...); d.draw(canvas); It worked like a charm. In this case the InputStream is an AssetManager.AssetInputStream . So now I want to load it from the sdcard. Here's what I tried to do: File f =

how to merge Images and impose on each other

末鹿安然 提交于 2019-11-30 06:55:48
Suppose I'm uploading two or more than two pics in some Framelayout . Hereby I'm uploading three pics with a same person in three different position in all those three pictures. Then what image processing libraries in Android or java or Native's are available to do something as shown in the pic. I would like to impose multiple pictures on each other. Something like these:- One idea is to : Do some layering in all those pictures and find mismatching areas in the pics and merge them. How one can merge multiple picture with other? By checking the di-similarity and merge with each other? Are there

DiskLruCache from android tutorial is missing lots of methods.

佐手、 提交于 2019-11-30 06:47:14
问题 Here is the disk cache tutorial I'm following. I've downloaded the source code to DiskLruCache but none of the methods used in this example exist in the source code. http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html#disk-cache Do I need to implement these methods myself or is there a version of DiskLruCache that I'm missing somewhere? 回答1: Here is the complete implementation of DiskLruCache . First download DiskLruCache.java from AOSP. Here is my DiskCache.java a

Correspondence between ImageView coordinates and Bitmap Pixels - Android

自作多情 提交于 2019-11-30 05:03:27
In my application I want the user to be able to select some content of an Image contained inside an ImageView . To select the content I subclassed the ImageView class making it implement the OnTouchListener so to draw over it a rectangle with borders decided by the user. Here is an example of the result of the drawing (to have an idea of how it works you can think of it as when you click with the mouse on your desktop and drag the mouse): Now I need to determine which pixels of the Bitmap image correspond to the selected part. It's kind of easy to determine which are the points of the

How to add image effects in android ?

筅森魡賤 提交于 2019-11-30 01:07:50
I am trying to apply effect (sepia, brightness, bloom and other image effects if API for them is available) on an image for my android app. But I am totally unable to get precise and well mannered code or concept for solving such problem. Although Android 4.0 (API 14) have build in android.media.effect api in it but I am working in Android 2.1 which have only Bitmap, Drawable, DrawableBitmap e.t.c but i am not getting which to work with. I have written lots of image effects here, you can try: http://xjaphx.wordpress.com/learning/tutorials/ Note: the tutorials are meant to explain how image

Scaling image of ImageView while maintaining center point in same place

那年仲夏 提交于 2019-11-29 23:33:01
问题 I have set a prescaled Bitmap as ImageView's source. Then I've read Matrix of an ImageView and shift Bitmap of an ImageView via matrix.postTranslate(shiftX, shiftY) . Now I want to zoom in / out and image while maintaining center of ImageView at the same point of Bitmap that was before scale. If I try to zoom in an image with matrix.postScale(zoom, zoom) , point that I want to maintain (blue dot) shifts to other place (purple dot). I have tried several different ways to shift Bitmap back, but

How do I prepare images for all the Android resolutions?

删除回忆录丶 提交于 2019-11-29 20:41:50
In iOS preparing graphics is simple. There are either a normal image (height x width) or a retina image which is @2x (2 times height x 2 times width). However, since I'm new to Android, I see a ton of drawable-* folders in Eclipse where the * can be "hdpi" or "ldpi" or "mdpi" or "xhdpi" or "xxhdpi". Can someone very clearly and simply list for me what I must do to satisfy each of the display possibilities so my images will look right in each instance? I'm envisioning an answer will be a bullet list with each "*" listed and a sub-bullet list including the things that must be done. I'd also

How to resize an image to fit multiple screen densities

梦想的初衷 提交于 2019-11-29 15:45:01
问题 I need to add an avatar to a grid item. I want to know how to handle the resizing of an image chosen from the phones gallery. Once chosen, I imagine some resizing will be needed, to fit it into the grid. However, do I need to store a resized image for each screen density; store one xhdpi version and scale down for other devices, or be clever in some other way? The reason is, the app stores this image to a cloud db and other people can download this image. They may see the image on different

Android image sharpening, saturation, hue, brightness, and contrast

旧城冷巷雨未停 提交于 2019-11-29 15:37:28
问题 I'm trying to create an app that will allow me to adjust the hue, saturation, brightness, contrast, and sharpness of an image by adjusting the seekbars for each of the above fields. like at http://ronbigelow.com/articles/workflow_basic/hue-saturation_tool.jpg I have no idea how to do this and I can't find any tutorials online. Does Android have anything that does this already? Do I have to manipulate the colors of individual pixels? If I have to mess with the pixels, how would I do that? 回答1: