imageview

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

£可爱£侵袭症+ 提交于 2019-12-03 14:04:54
问题 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? 回答1: 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"

How to rotate a drawable with anti-aliasing enabled

守給你的承諾、 提交于 2019-12-03 13:53:57
问题 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

Display replica image with mirror image in android [closed]

南笙酒味 提交于 2019-12-03 13:36:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want above type of image view in android. Please suggest me better solutions for implement this. 回答1: 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 =

How to get the image name of the ImageView in Android?

馋奶兔 提交于 2019-12-03 13:23:35
I have an imageview in android . I want to get the name of the image which is set in the in the imageview. How can I do that ? ImageView v = (ImageView)findViewbyId(R.id.img); //String name = findImageName(v); if( name.equals(a)) { //do something } else{ //do something } For this first of all you need to set a tag for your ImageView <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageview1" android:background="@drawable/bg1" android:tag="bg1"/> Now get the image name currently set on your ImageView by doing the following, ImageView v =

How I can update image of fresco SimpleDraweeView, if it was set once by setImageURI

筅森魡賤 提交于 2019-12-03 12:56:10
I am using Facebook Fresco library and SimpleDraweeView for displaying avatar image from file: Uri avaURI = Uri.fromFile(new File(getCacheDir(), Constants.AVA_FILE_NAME)); simpleDrawee.setImageURI(avaURI); But what if I changed file with picture (deleted previous file and created the same one with new image), how can I update (refresh) SimpleDraweeView? Its still display the old version of image. (I tried to disable cache by Fresco.getImagePipeline().evictFromMemoryCache(avaURI); but it didn't help). I believe you were on the right track. There are two more levels of storage that the old image

Pull to Zoom Animation

試著忘記壹切 提交于 2019-12-03 12:44:45
问题 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 =

ImageView: automatically recycle bitmap if ImageView is not visible (within ScrollView)

守給你的承諾、 提交于 2019-12-03 12:43:43
So, I've been looking at the ImageView source for a while, but I haven't figured out a hook to do this yet. The problem: having, let's say, 30 400x800 images inside a ScrollView (the number of images is variable). Since they fit exactly in the screen they will take 1.3 MB of RAM each. What I want: to be able to load/unload bitmaps for the ImageViews that are currently visible inside a ScrollView. If the user scrolls and the bitmap is no longer visible (within a distance threshold) the bitmap should be recycled so that the memory can be used by other bitmaps in the same ScrollView. I'm doing

Android ImageView drop shadow

只谈情不闲聊 提交于 2019-12-03 12:27:09
I'm trying to add a drop shadow to an ImageView. The other Stackoverflow answer seems to be using canvas and bitmaps etc, way more complicated than it needs to be. On iOS I would do something like this: myImageView.layer.shadowColor = [UIColor redColor].CGColor; myImageView.layer.shadowRadius = 5; myImageView.layer.shadowOffset = CGRectMake(0, 5); and it would render a drop shadow, regardless of whether the shadow is being applied on a view, an image or text. I've tried to do the same on Android but it just refuses to work: birdImageView = new ImageView(context); birdImageView.setImageResource

Change the size of ImageView on zooming

怎甘沉沦 提交于 2019-12-03 12:18:24
I am using chrisbanes PhotoView to implement pinch zoom..Image zooms on pinching and double tapping but i can't see that my image streched to full screen on zooming..on zooming it looks that image zooms inside a box and part of image disappears on zooming...How can i implement image zoom so that height of Image increases on zooming?I am using NetworkImageView ( of Volley library). NetworkImageView imageView; PhotoViewAttacher mAttacher; imageView = (NetworkImageView) mImgPagerView.findViewById(R.id.imageitem); mAttacher = new PhotoViewAttacher(imageView); NetworkImageView.java ( of Volley

Make ImageView with Round Corner Using picasso

不打扰是莪最后的温柔 提交于 2019-12-03 10:32:24
问题 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. 回答1: I am using this transformation: https://gist.github.com/julianshen/5829333 Picasso.with(activity).load(url).transform(new CircleTransform()).into(imageView);