How to scale (zoom and move) to x,y coordinates of Bitmap in PhotoVIew?
See original GitHub issueAt start I have Bitmap and x,y point on the Bitmap.
How to scale, zoom and move image to x,y coordinates of the bitmap?
int bitmapWidth = bitmap.getWidth();//2418
int bitmapHeight = bitmap.getHeight();//1889
float x = 1209f;
float y = 944f;
float targetScale = 4f;
attacher.setScale(targetScale, x,y, false);//it doesnt work
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
How to scale (zoom and move) to x,y coordinates of Bitmap in ...
First of all you need to convert your coordinates to the PhotoView : int bitmapWidth = bitmap.getWidth();//2418 int bitmapHeight = bitmap.
Read more >How to scale (zoom and move) to x,y coordinates of Bitmap in ...
At start I have Bitmap and x,y point on the Bitmap. How to scale, zoom and move image to x,y coordinates of the...
Read more >Enlarge a view using a zoom animation - Android Developers
This lesson demonstrates how to do a touch-to-zoom animation, which is useful for apps ... scale properties (X, Y, SCALE_X, and SCALE_Y).
Read more >photo_view | Flutter Package - Pub.dev
PhotoView enables images to become able to zoom and pan with user gestures such as pinch, rotate and drag. It also can show...
Read more >Agisoft Metashape User Manual - Professional Edition ...
To adjust the bounding box manually, use the Resize Region, Move Region and Rotate ... on how to define x and y coordinates...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok so I finally understand and make it work. That doesn’t work because I used the animation on the setScale, which was call in an other thread.
And in the same time I tried to simulate the movement to re-center the point int the center of the screen.
But when this part of the code get executed the scale isn’t finished, so the movement can’t happened cause the image is full sized and we can’t drag a full size image.
So to resolve that I remove the animation.
An other solution could be use a callback or coroutine for the scaling and in the same time do the move, cause we will be in a sequential code part. But the
AnimatedZoomRunnable
is in another thread so we will go till the :And go back to the next line of the coroutine.
So actually I don’t have more option to do that. Maybe place a button to be able to center the point in the middle of the screen like in GoogleMap and execute the “simulating drag” when user click ?
Or does there is a way to get notify when
AnimatedZoomRunnable
is finished ?Let me know if you found something interesting. Thanks.
@Kolyall try this, you need to calculate focal points