how to center an image from gallery? If i use setSelection()
the gallery didn't are center, she move sometime in left sometime in right.
She move in center only if the image was in extremities or if the selected image was in center.
If i do a second clique the picture go in center, i don't understand why. I use a setOnItemClickListener to change the image.
This is what the behavior of the Gallery.Just Use the classes of the Gallery Customize it which involve CustomGallery CustomAbsSpinner and CustomAdapterView and change the function of Gallery class getCenterOfGallery() as per your requirement.
Related
I have a frame image and another image selected from gallery. What i want is to place that image inside the transparent part of that frame image and also I can apply onTouchListener on the image selected from gallery.
Like in the app whose link is provided following.
https://play.google.com/store/apps/details?id=com.lyrebirdstudio.pipcamera
Any idea or concept will be helpful.
My IDEA
Here is what i am thinking to create a relative layout and setting the Picture Frame as a background and then scaling the other image according to the size of the relative layout. Then i can apply onTouchlistener on the image easily.
Am i going in right direction or there is some better way though which i can achieve the desire results?
Thanks in advance.
http://stacktips.com/tutorials/android/how-to-drag-a-view-in-android
OR
how to drag an image by touching in android?
hope it helps..
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 :)
I have a android gallery and image view in my main layout. When I touch an image in Gallery I display that image in the imageview below. What I am trying to achieve is I want the user to be able to fling the image itself to left or right to go to next or previous image. I have been able to do that also. But at the same time when the user flings to next image I want the Gallery on top also to scroll to next image. How Can I achieve this. Any help will be greatly appreciated.
You will have to use the setSelection method.
if( fling right ){
gallery.setSelection(gallery.getSelectedItemPosition() + 1);
}
I have a Gallery. I have used the android:unselectedAlpha parameter so that the center image in the Gallery is more bright. However, I would like to have this center image size to be bigger than other images. Is there a way to do this ?
You could add and onClickListener to each image. When the image is clicked you could change the layout so that the image is then bigger.
I have followed the android gallery tutorial to build a simple gallery which is exactly the same as the tutorial's.
Now, I would like to improve the gallery from the tutorial to show only one image at one time(in the tutorial, several images are showing at once), that's only show one image which occupy the whole gallery area.
Then, only finger touch and move the current image to left or right will make the neighboring next(left or right) image to be shown.
How should I modify the tutorial's code? any suggestions?
You could make the Image the same size as the screen:
i.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.FILL_PARENT, Gallery.LayoutParams.FILL_PARENT));
i.setScaleType(ImageView.ScaleType.FIT_XY);
This thread might be useful
Android GalleryView Problem