I want to show image with specific zoom level using Glide library in Image view. I tried .centerCrop() but it zooms image very slightly. Is there any way to achieve this?
Try this
Glide.with(context).load("your-image-url-or-resource").override(600,200).into("your_image_view");
override(600, 200) is the image dimension you wish to display the image in, and apply centerCrop. Hope this helps you.
Related
I have implemented custom imageView with a pinch option. Now I stuck in after pinch whatever the image visible in imageview. Only get the pinched/visible image as cropped & set that cropped image to another imageview. Pls, help to achieve this.
How do I display images in a facebook like feed? So far I've been using match_parent for width and wrap_content or fixed height. This works well but I need to show proper blank space for image feeds while it's getting lazy loaded. Like how do I set the dimensions properly for the image before loading it from the internet.
I think about getting the aspect ratio or the image dimensions itself via the api. Is it the only correct way or is there some other better way to achieve it using glide or any image loading library?
If you are using glide, you can set a place holder image or drawable with the dimensions you need while the real image is being downloaded.
Glide
.with(context)
.load(UsageExampleListViewAdapter.eatFoodyImages[0])
.placeholder(R.mipmap.ic_launcher) // can also be a drawable
.into(imageViewPlaceholder);
I set image From Gallery and Camera to Imageview.I used Touchimageview for pinch Zoom Functionality for imageview.
Here is Link For this Touchimageview : https://github.com/MikeOrtiz/TouchImageView/blob/master/src/com/ortiz/touch/TouchImageView.java
But image is not set ProPerly in Imageview.
In the Picture,
The left side is What Actually happen with me.
The Right side which i wanted Fit to imgeview same as Imageview height.
I Used ScaleType = "CenterCrop" But After That i Cant able to Zoom in Out in Imageview.
1).How to Crop Bitmap Like Fit to imageview with keep aspect resio?
2).or How to set Image From gallery or camera to Fit To imageview And Add Zoom in out Functionality?
Help me to Solve This issue
Thanks You in Advance
For zoom-able ImageView user Gesture ImageView Library
You can download library from here, it's easy to use. this library provides you zoomable ImageView so use Gesture ImageView instead of Simple ImageView
https://github.com/jasonpolites/gesture-imageview
use android:scaleType="fitxy". Make sure your image is of higher resolution, otherwise the image will lose its quality. It may also look stretched if it the image doesn't maintain aspect ratio
I want to change image cropping frame for my android project. I have now image1 but I need image2 please help me.
You can use Cropper image cropping tool .
It provides a way to set an image in XML and programmatically, and displays a resizable crop window on top of the image. Calling the method getCroppedImage() will then return the Bitmap marked by the crop window.
https://github.com/edmodo/cropper I think this is helpful for this question. I have solved my problem from this .
I am trying to implement a crop image for my app.
What I want to do is that I've an imageview set to 300x300 .I am taking images from
CAMERA and GALLERY now the images can be bigger than 300x300. I want to implement
a cropping tool using which I can drag the image inside imageview so that I can select the useful portion of 300x300 of the image.
I want to implement the same feature which this app implemented for cropping.
Can anyone point me in the right direction ?
Try this:
https://github.com/biokys/cropimage
But if you want to drag and fit useful portion of a image in a Imageview than you can use MultiTouch View.
https://code.google.com/p/android-multitouch-controller/
You can move the image on a custom view. Zoom and Pinch. Once you found the useful area. Take a screenshot of the imageview.
hope any of the solutions helps :)