Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fit image in full screen in ImageViewTouch #30

Open
saurabhkpatel opened this issue May 4, 2013 · 6 comments
Open

How to fit image in full screen in ImageViewTouch #30

saurabhkpatel opened this issue May 4, 2013 · 6 comments

Comments

@saurabhkpatel
Copy link

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

@Malachiasz
Copy link

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.

@saurabhkpatel
Copy link
Author

Hi Thanks for you answer.

Have you suggested me solution for my question .

I really needs help for this.

Thanks

@Malachiasz
Copy link

#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.

@saurabhkpatel
Copy link
Author

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
Copy link
Author

@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

@Malachiasz
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants