ImageViewZoom icon indicating copy to clipboard operation
ImageViewZoom copied to clipboard

option to force fill image to view

Open jeancaffou opened this issue 12 years ago • 10 comments

fill image in view instead of fit to view and image can not be smaller than the view in any dimension

example:

img = (ImageViewTouch) findViewById(R.id.image);
img.FORCE_FILL = true;

I'm sorry for the large diff, as I used a code formatter, the actual difference is:

public boolean                  FORCE_FILL          = false;

in ImageViewTouchBase class

and

float scale = FORCE_FILL ? Math.max(widthScale, heightScale) : Math.min(widthScale, heightScale);

in getProperBaseMatrix method in ImageViewTouchBase class

jeancaffou avatar Oct 07 '12 22:10 jeancaffou

jean for some reason this slows down my scrolling horizontally on the image to a point of being a bit unresponsive.

SalmanTKhan avatar Jan 27 '13 11:01 SalmanTKhan

Using above code i can fill image in fit to Screen , right now its not happening. why?

saurabhkpatel avatar Apr 26 '13 12:04 saurabhkpatel

"Using above code i can fill image in fit to Screen , right now its not happening. why?" because fill modifier is not supported

Malachiasz avatar May 07 '13 22:05 Malachiasz

why dont use the setDisplayType( DisplayType.FIT_TO_SCREEN ) ?

sephiroth74 avatar May 07 '13 22:05 sephiroth74

@Malachiasz Which Fill modifier is not supported? So what is the use of above mentioned code?

saurabhkpatel avatar May 09 '13 02:05 saurabhkpatel

Well, the above code works for me.

jeancaffou avatar May 09 '13 05:05 jeancaffou

hi @jeancaffou thanks for your reply... I used above code. which you mentioned in first post on this thread.

but its really didnt work for me. Please can u please explain me more about this.?

public boolean FORCE_FILL = false;

Thanks.

saurabhkpatel avatar May 09 '13 14:05 saurabhkpatel

@sephiroth74 Thanks for your reply. I used this line 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 remaning 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

I mentioned the diff.

The full code of ImageViewTouchBase.java

is here: https://github.com/jeancaffou/ImageViewZoom/blob/89b324f7108dc30f281b22d3fa99751efc608d19/ImageViewTouch/src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java

jeancaffou avatar May 09 '13 14:05 jeancaffou

Thanks for your fast response. @jeancaffou .

I used some extra things also because i want to integrate this ImageViewTouch with Universal Image Loader also.

I used below xml file content for ImageViewTouch. I used correct scaleType?

<it.sephiroth.android.library.imagezoom.ImageViewTouch
    android:id="@+id/iv_pager_image"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:adjustViewBounds="true"
    android:contentDescription="@string/descr_image"
    android:scaleType="matrix" />

And i Changed in ImageViewTouch file as i had some issues with view pager scaling.

http://stackoverflow.com/questions/13359205/image-isnt-displayed-in-imageviewzoom

http://stackoverflow.com/questions/13398288/image-zoom-issue-with-universal-image-loader-and-view-pager

Thanks

saurabhkpatel avatar May 09 '13 14:05 saurabhkpatel