imageview

How to display an image in full screen on click in the ImageView?

断了今生、忘了曾经 提交于 2019-12-03 03:55:46
I need to open an image in full screen upon click in the ImageView, like a gallery with one image! How would I do that? Jorgesys this is a basic example: the layout activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center"> <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:src="@drawable/ic_launcher"/> </LinearLayout> onCreate() method: private boolean zoomOut =

Display replica image with mirror image in android [closed]

一曲冷凌霜 提交于 2019-12-03 03:44:27
I want above type of image view in android. Please suggest me better solutions for implement this. Royston Pinto I use the below code to achieve this effect public Bitmap applyReflection(Drawable drawable) { Bitmap originalImage = ((BitmapDrawable)drawable).getBitmap(); final int reflectionGap = 4; int width = originalImage.getWidth(); int height = originalImage.getHeight(); Matrix matrix = new Matrix(); matrix.preScale(1, -1); Bitmap reflectionImage = Bitmap.createBitmap(originalImage, 0, height/2, width, height/2, matrix, false); Bitmap bitmapWithReflection = Bitmap.createBitmap(width,

How to rotate a drawable with anti-aliasing enabled

穿精又带淫゛_ 提交于 2019-12-03 03:12:35
I need to rotate an ImageView by a few degrees. I'm doing this by subclassing ImageView and overloading onDraw() @Override protected void onDraw(Canvas canvas) { canvas.save(); canvas.scale(0.92f,0.92f); canvas.translate(14, 0); canvas.rotate(1,0,0); super.onDraw(canvas); canvas.restore(); } The problem is that the image that results shows a bunch of jaggies. http://img.skitch.com/20100608-gmdy4sexsm1c71di9rgiktdjhu.png How can I antialias an ImageView that I need to rotate in order to eliminate jaggies? Is there a better way to do this? If you know that your Drawable is a BitmapDrawable, you

Pull to Zoom Animation

六眼飞鱼酱① 提交于 2019-12-03 03:07:07
Many of us must have come across apps like Tinder and Dripper where you can pull down on the view containing an image and the image zooms in. And then when you let it go, the image zooms out to go back to its origin state. Let's take an example from Tinder : Original State: and Zoomed-in state when pulled: In iOS it is done by - (void)viewDidLoad { [super viewDidLoad]; self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"church-welcome.png"]]; self.imageView.contentMode = UIViewContentModeScaleAspectFill; self.cachedImageViewSize = self.imageView.frame; [self.tableView

How to clear ImageView correctly?

泄露秘密 提交于 2019-12-03 02:18:36
For example, in my Activity I have such code (I skip the initialization of variables): ImageView iview; //some ImageView Bitmap b; //some Bitmap iview.setImageBitmap(b); Question is - how to clear iview resources correctly (with or without destroying view) ? Would ImageView free it's resources (used in native code) after b.recycle() ? I suppose, that ImageView doesn't just free it resources after Activity onStop (or onDestroy ). imgview.setImageResource(0); or imgview.setImageDrawable(null); no you need to unbindDrawables, you can do it by setting iview.setImageDrawable(null); Dhiraj Singh You

Android ImageView Fixing Image Size

断了今生、忘了曾经 提交于 2019-12-03 02:16:32
问题 I have an Android Application, where I have an ImageView , I need to keep the size constant, there can be various images that I need to put into this ImageView , of different sizes. I just need to ensure that all the Images must fit into the ImageView , the Image should increase in size if it is smaller and should decrease, in case it is bigger. Thanks a lot for your time. 回答1: Fix ImageView's size with dp or fill_parent and set android:scaleType to fitXY . 回答2: In your case you need to Fix

Android Google Map to show as picture

余生颓废 提交于 2019-12-03 01:45:09
问题 I've implemented Google Maps V2 in my android app and now I would like to do something differently. I'm showing a location (longitude, latitude) with a marker. The problem is that this is showing in my activity as a Map. I would like to show it as a ImageView and only if someone clicks on it show the map interface. Basically what I want to do is a static preview of the location and display it as a picture (with a frame and rounded corners) When clicked then open maps and give all

Android apply colorMatrix colorFilter on part of imageView with a mask

家住魔仙堡 提交于 2019-12-03 01:29:47
I want to change the brightness on certain part of an image. I know how to use ColorMatrix to change the brightness(or hue) of an image. But it will be applied to the whole image. I have a mask file (black and white image). I want to apply the brightness change only on the the white part of that mask.How to do this in Android? Below is a mask image and the result I want to get. for given bitmap and mask: first create a temporary bitmap: bitmap = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.bitmap); mask = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.mask); float[]

Make ImageView with Round Corner Using picasso

梦想的初衷 提交于 2019-12-03 01:03:17
I know there are lots of link available to make ImageView Round Corner. But I'm Using Picasso Library for Image Loading.. I refer the link to get result. But the Problem is that I'm Using it in ListView and for the LIstView's first item ImageView its working perfectly fine but for the remaining once transformation is not working. I am using this transformation: https://gist.github.com/julianshen/5829333 Picasso.with(activity).load(url).transform(new CircleTransform()).into(imageView); You can use RoundedCornersTransformation class of picasso-transformations library. Example : final int radius

How to get the whole bitmap attached to an ImageView?

谁说胖子不能爱 提交于 2019-12-03 00:02:58
I tried to get Bitmap attached to an ImageView, using ImageView.getDrawingCache(); But I found that the returned Bitmap was not the same as I'd like to get from the ImageView. It was always smaller than the real image. I had known that, the method getDrawingCache() should not have the view if it is bigger than the screen as the visible portion of the view is only drawn and the cache holds only what is drawn. Could I get the whole bitmap attached to a ImageView? If you just want the Bitmap from a ImageView the following code may work for you:- Bitmap bm=((BitmapDrawable)imageView.getDrawable())