Rich image scroll and zooming on android

I'm looking for a way to implement image zoom and scrolling the way it is implemented in Droid Comic Viewer. Is there any quick way to do that? If not, then could you please give some advices at least on implementing kinetic scrolling.


Asked by: Aida718 | Posted: 24-01-2022






Answer 1

It wasn't quick for us. When we implemented that part of Droid Comic Viewer we used the source code of ScrollView as reference to create a view able to handle horizontal and vertical scrolling.

Scrolling and zooming have a lot of quirks that we gradually solved, and some of them that we still have to solve.

If you're not in a hurry, we plan to release the source code later this year.

Answered by: Catherine769 | Posted: 25-02-2022



Answer 2

There are many ways to implement zoom. As easy way is to set an image matrix on the ImageView:

Matrix matrix = new Matrix();
matrix.postScale(scaleX, scaleX);
matrix.postTranslate(offsetX, offsetY);
mImageView.setImageMatrix(matrix);

If you're not familiar with touch event processing, look into OnTouchListener. Using a GestureDetector can help simplify things further.

Answered by: Thomas298 | Posted: 25-02-2022



Similar questions

Zooming on android dev - google maps becomes slower

I've developed a GPS app in which i record the user routes and show it on the map. But panning around on the map when reviewing my route is painfully slow, it takes at least 4 or 5 seconds for the map to respond the finger swipes. I've overridden the onDraw() method and drawing the lines to show the routes whenever we zoom on the map, the lat-long is again drawn by calling onDraw()(Overridden) method, which has t...


Zooming on android dev - google maps becomes slower

I've developed a GPS app in which i record the user routes and show it on the map. But panning around on the map when reviewing my route is painfully slow, it takes at least 4 or 5 seconds for the map to respond the finger swipes. I've overridden the onDraw() method and drawing the lines to show the routes whenever we zoom on the map, the lat-long is again drawn by calling onDraw()(Overridden) method, which has t...


Zooming and Panning of view in android

Hi friends I am creating one app where i put two views. first is imageview and the other one is my customeview. i am drawing image on my custom view. my custom view code is as follow public class DrawView extends ImageView{ @SuppressWarnings("unused") private static final String TAG = "DrawView"; Painter painter = new Painter(); PathStack pathStack; private DrawApplication drawAp...


google maps - Blank screen when zooming in/out in MapView in Android 2.2

I have an application that puts some overlays in a MapView of the Google Maps api for android working perfectly in Android 1.6, and when I tested in an Android 2.2 (LG Optimus One) when zooming in/out (fast) the MapView fails to render the overlays and map, showing nothing, just a blank screen. Now, i have noticed that if one is connected to the internet, the map reloads after downloading the maptile, fixing the pr...


zooming - Is there a 3rd party library for Android Pinch Zoom

Closed. This question does not meet Stack Overflow guid...


zooming - android zoom mapView like maps App

when I stop to zoom (pinch to zoom) on a mapView, the zoom continues until it reaches a zoom level whereas Google maps app stop. I would like to have maps-like behavior. Can I have that ? thanks edit : can i have an onZoomListener for pinch to zoom (like for zoomsButtonscontroller) ?


css - how do i make it so that zooming in on the android doesnt change the size of the text

I am making CSS voice bubbles, and I fit the text to the bubbles using em to set the text size, but now when I zoom in the text changes size too and it overflows out of the bubble. I don't want to set the text size with px because I want it to be cross-browser accessible, so is there a way to make it so the text doesn't scale itself to always fit the screen?


Android Zooming For Graphs

I need to implement zoom functionality for graphs which are retrieving from web. These graphs are from php web-server so how to implement zooming functionality to these graphs. Any one can help me to come out from this issue. This is my java class code for retriving graphs from web. localPalladium1YButton.setOnClickListener( new View.OnClickListener() { public void onClick(View view) ...


android - Getting Force close error on Google Maps while zooming and panning

Hi getting the following error while zooming and panning google maps. Kindly tell what could be the possible reason 07-30 19:50:02.003: ERROR/AndroidRuntime(3259):java.lang.OutOfMemoryError: bitmap size exceeds VM budget 07-30 19:50:02.003: ERROR/AndroidRuntime(3259): at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method) 07-30 19:50:02.003: ERROR/AndroidRuntime(325...


Zooming image in android

I want to add an image in my application which is like a road map image. I want to add zooming features to this image as well as horizontal scrolling when the image is zoomed. I have written some code but it allows only zooming and not scrolling. Code: public class Zoom extends View { private Drawable image; private int zoomControler=20; public Zoom(Context context) { ...


java - Zooming in android - keep image in view

I know there are tons of threads on actually getting pinch zoom implemented - but I got this far already. I'm using SimpleScaleGestureListener to handle the pinching. I've managed to make sure you can't zoom out farther than to keep the image height the same as the screen size (so you're image height will always be at least the height of the available screen size). However, I'm looking for a way to automati...






Still can't find your answer? Check out these communities...



Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android



top