ImageViewZoom icon indicating copy to clipboard operation
ImageViewZoom copied to clipboard

How to fit image in full screen in ImageViewTouch

Open saurabhkpatel opened this issue 12 years ago • 6 comments

I am using ImageViewTouch library to zoom a image instead of imageview.

<it.sephiroth.android.library.imagezoom.ImageViewTouch android:id="@+id/imageweb" android:layout_width="fill_parent" android:layout_height="fill_parent" android:adjustViewBounds="true" android:background="@drawable/bg_loading" android:scaleType="fitCenter" />

I want to load the image on ImageViewTouch control and the width of image will auto fits my screen. How to fit only width and height both to my mobile screen?

Here when i do 3 times double tap means in 1st time its get zoomed in 2nd time also but in 3rd times its fits to height and width of the the device screen.(I want this 3rd time result at the time of first load of normal image)

But its not loaded fit to height and width (X and Y) at first time.? Please help me to sort out this issue.

I already tried with android:scaleType="fitXY" but its not working

I used this library classes May be i have to change here some thing.

first second

Thank you for support

saurabhkpatel avatar May 04 '13 05:05 saurabhkpatel

I have: ivImage.setDisplayType(DisplayType.FIT_TO_SCREEN); ivImage.setImageBitmap(bmp, imageMatrix.isIdentity() ? null : imageMatrix, ImageViewTouchBase.ZOOM_INVALID, ImageViewTouchBase.ZOOM_INVALID); and: android:scaleType="matrix" (because of "Unsupported scaletype. Only MATRIX can be used")

but images are only fit to screen, when they're larger than the screen. Is it possible to scale them up? Also when they're smaller resolution as screen an thus not fit to screen, then scaling doesn't work - image act like static.

does it have something to do with my settings min and max zoom to: ImageViewTouchBase.ZOOM_INVALID?

thank you for explanation.

Malachiasz avatar May 07 '13 16:05 Malachiasz

Hi Thanks for you answer.

Have you suggested me solution for my question .

I really needs help for this.

Thanks

saurabhkpatel avatar May 07 '13 16:05 saurabhkpatel

https://github.com/sephiroth74/ImageViewZoom/pull/12 - that doesn't work for you? If not then you have to rewrite the code by yourself, because author doesn't work any more on this plugin.

About my previous question. Problem with upscaling was to low getMaxScale value.

Malachiasz avatar May 07 '13 22:05 Malachiasz

hi there

Thanks for updates on my question. I already tried that #12 that is not working. Now i am going to test which is mentioned by @Malachiasz.

Thanks keep in touch.

saurabhkpatel avatar May 09 '13 02:05 saurabhkpatel

@Malachiasz I used your suggestion in my code. and i used this setDisplayType( DisplayType.FIT_TO_SCREEN ).

I am able to make fit image on screen but when i double tap the image and than scroll the image Images is cutting and i cant able to see remaining part. only able to see fir to screen part. Please can u help me to sort out this issue. Thanks

saurabhkpatel avatar May 09 '13 14:05 saurabhkpatel

So what do you want? You want the image to loose aspect ratio on zoom ?

Malachiasz avatar May 14 '13 07:05 Malachiasz