Scale ImageView aswell as Image - android

Currently, I have an XML file with lots of imageviews in it that can be scrolled through using navigation buttons. These imageviews can be rotated, scrolled and moved but when they are they will leave the bounds of the imageview and so you cant see parts or all of them.
Is there any way that I can resize the imageview programmatically at the same rate as the image is being scaled?
Alternatively, is there a way that i can draw the images to a canvas and each of them can be scaled individually?

Related

Android special layout

I need to create a layout in Android like the image below:
The red rectange is the viewport. it should be possible to zoom in and pan until the borders of the image that contains the 4 imageviews.
I've tried putting the images in a gridview, that didn't really work
After that i tried putting them in a tablelayout, but the images have to keep aspect ratio.
so each row in the tablelayout had the correct width but the height was only half the rowview.
So when i pan it's possible to see the white edges from the rowview that was not filled completely
What would be the best way to achieve this layout?

image animation cropped by layout bounds

I have an image that gets scaled from large to small as it spins. It's mean to be a fancy animation to simulate a tile being place on a board. The animation works as expected except for one thing: This image is cropped.
Each row of tiles is inside of a Horizontal LinearLayout. Each LinearLayout is inside of another LinearLayout (Vertical). This give the board. Sadly, the image animation is getting cropped to not excede the bounds of the parent layout. I don't want that. I want the image to be displayed and animated as if it's on top of everything else. I want it to exceed the layout.
Any idea how to fix this?
Here's a couple of screenshots:
Your image is constrained to fit within it's parent view as per design. You might want to use a canvas to hold all your tiles instead (keep in mind the bounds of the canvas for the corners otherwise you will have the same issue), or look into other layouts that might be able to accommodate your needs.
From: http://developer.android.com/guide/topics/graphics/view-animation.html
Note: Regardless of how your animation may move or resize, the bounds of the View that holds your animation will not automatically adjust to accommodate it. Even so, the animation will still be drawn beyond the bounds of its View and will not be clipped. However, clipping will occur if the animation exceeds the bounds of the parent View.

Android - How to implement Vertical Scroll in an ImageView

I'm creating an app in which on click of listview items I'm showing images. Now the size of those images is generally width:480 and height is variable, most of the time > 800.
I'm using ImageView to show those images.
Now if I use simple imageview and show the image as setContentView(R.image), the image fits itself EXACTLY to 480x800 which results in distortion of image content.
I tried to implement suggestions given at
Android: Scrolling an Imageview
but again no luck. Here I'm able to get the scrolling of the ImageView but not what I want.
What I want is that the image doesn't change it pixel ratio. It simply shows to the user on the screen (full screen width) and with a vertical scroll to see the content that is beyond the 800 px ratio.
Kindly suggest what should I do in ImageView XML and my activity class to achieve the same.
Currently i'm implementing everything in Android: Scrolling an Imageview so code is same as it's there.
Try wrapping the ImageView in a ScrollView.
And don't forget to set the ImageView's scale type to something like FitXY.

how to check two images on imageview are overlapping to eachother

I am creating an application.I am overlapping two image on each other. My image is bigger than screen so imageView is adjusting it .I want to know that images are overlapping each other or not ...if they are not overlapping then how should i do that they overlap to each other....
this is image now image now i want to overlap this image but i want to make sure tht this image should be overlap to each other properly ........

Drawing a compound image from smaller images

I want to draw an image on canvas constituted from smaller images, and make the new compound image scroll-able both horizontally and vertically as well as enable zoom-in, zoom-out and pan functionality. Any suggestions as to which View (container) I should use?

Categories

Resources