I need to build a component to view large images.
I cannot put the ImageView in a ScrollView because I will need to be handle other touch events on the image.
The ideal would be to build a "viewer"
with an horizontal handle
and a vertical handle
that enable to move where the picture is centered so that I can scroll the image using the handles without touching the picture itself.
I would like to achieve something like in the following picture, I have researched but I was not able to find any Android API or other component/library that I could use.
Thank you very much for any suggestion.
Best thing I can think of is use two custom scrollbars for the horizontal and vertical scroll. In an onChange() function you can change the crop area on the master image and display the cropped image. Depedning on how it is done you can get a slide effect going for the image.
Related
I'm working on image multi touch events, that have an image with touchEvents like googleMaps's touchEvents( pinchZoom and move togather with 2 fingers ), I tried GestureImageView and cusomized it and could implement that. but I'm not sure it is correct way or there is another method for it.Is there any way to do that ?
also I want to show different parts of the large image by clicking on each part and show theme so that it seams that camera moves view on the image.
Is there any library or any tools for this purpose in android?
I will be appreciate if help me.
Thank you.
I want to create an image auto scrolling for an outer-space type of game. To make it more exact, I want to load 2 background image that uses a single image occupying the whole screen and auto-scroll it alternatively to create an animation that the background image is moving. Don't get confused with auto scrolling and and shifting to another image automatically. I really meant auto scrolling like moving background using 1 image.
I did some research but what I saw are segments of java codes that made me confused. If possible can anyone provide me an example? From loading the image from xml (should I use an imageview with this? or just set the background image of the layout?) and how I should process it in java code to make an image autoscrolling.
Any ideas guys? Thanks! Sorry for asking too much.
I'm trying to create a stacked image gallery, this is a gallery on which all the pictures are overlaying each other in a stack(or pile), for example: a card pile, and the user would be able to see and touch just the upper image and to flip/throw it out of the screen(with translate animation). After throwing the first picture the user will see the second picture that was hidden underneath the first one and so on.
I didn't find a similar gallery in other apps except to "weheartpics" (for Iphone off course)
The line of solution that I'm following now is to create a FrameLayout, adding some overlaying pictures on it, to delete the upper picture when the user touch it(instead of throw it out of screen).
Use StackView, available on API Level 11 and higher.
Why not use a ViewPager and flip through your images from left to right? You can then utilize FragmentStatePagerAdapter to prefetch and cache your images as use flips through these
All right - here's another way:
Add ViewSwitcher with 2 ImageViews
Since you can't use drag and drop library look for some alternatives but generally you want implement dragging the top image. Hopefully that will expose the hidden image but if not you will have to swap images when the drag starts
Implement gesture performed listener to listen for the flick events on the top image
When image is flicked away:
a. Swap image views in ViewSwitcher (if not swapped already for the drag-n-drop)
b. Pre-load next image into hidden ImageView
Otherwise return top image into original location (don't load anything into hidden ImageView)
Ok, the solution for that problem was to use frameLayout and to add to it imageView from the code. It's easy to apply animations on the images and to remove/add them after the animation begins.
I want to implement pinch zoom functionality for a layout which have a background image and on background image it have 4 another image . see the image
I have 2 idea to implement my problem
Make a parent layout (framelayout) which will have these 4 images as child layout(imageview) and somehow (i dont know how) if i am able to make it pinch zoom. my problem will get solved
i can use webview but i dont know how to put these images in webview.
can anyone help me to get it solved.
Note : i want pinch zoom functionality only for background image. as if background image will get zoom, other images will also get zoomed. i dont want independent zoom for images 1 2 3 4.
Thanks
All layouts are already put in to the default FrameLayout, so, Merge as a root layout is enough.
As for zooming the main image, the only problem IMHO, is that these children could sometime catch the event instead of the root layout. So, you need do make them unfocusable and disabled. After that all events will be catched by the parent.
can anyone let me know how to keep an image on top of other image. If we select a portion of the top image it should display the below image portion.
Please share the samp
Thanks in advance.
-pavan
I'm not sure if this would completely answer your question... but firstly, images shouldn't really ever overlap in a LinearLayout. If you're using a RelativeLayout, they definitely can overlap, and the image on top will be whatever was loaded last in the XML.
If I understand what you're attempting to do - kind of transparency (so to speak) of the top image so that portions of the bottom image are displayed along with portions of the top image ... I do things like that all the time by overriding the onDraw() method on my View to handle the image painting myself. There's allot of examples on the net for this - simple stuff.