All, I've extended the ImageView in order to implement pinch and zoom scaling on the image. This is done by modifying the matrix and applying it to the image. Now, I am also overwriting the onDraw() to draw primitives (i.e. rectangles and circles). I've applied the matrix to the canvas and it appears to have handled the scaling properly, but the only problem is that that position is off on the drawn items. How do I go about translating the positions of the drawn items to reflect the new scale?
Android: Scaling ImageView and it's onDraw() items
3.2k Views Asked by serveace6 At
1
There are 1 best solutions below
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in VIEW
- Serve arbitrary html in angular data bind
- Switching CSS Just for that view?
- Setting % of a background color programmatically
- Change the View BackgroundColor on Tap
- Pass html.dropdownlistfor current value to Actionlink?
- Filter Field in List by boolean value in MVC
- Android How to change icon with button
- frame.origin Change error on View when Table Cell selected
- How to pass a specific model field to views' functions or methods?
- python django class based view and functional view
- django rest framework - adding to views.obtain_auth_token
- Is it possible to draw on an SFML window regardless of views?
- SQL Join Views - Duplicate Field
- Android change layout depending on if statement
- how to merge entity reference relationship field value
Related Questions in ZOOMING
- Make scaled-down image on HTML page clickable to see it in full size
- D3 Bounded Panning
- fabricjs - Zoom canvas in viewport (possible?)
- Google Maps v3 fitBounds inconsistent zoom
- Crop image with settable center and scale in Python PIL
- How to zoom into a picturebox image without changing the image sharpness?
- How can I implement a Zoom Panel with Java Swing libraries
- Divs move around when i zoom in/out
- How to check if user have zoom from js?
- Protractor key-down and send keys to zoom browser
- zoom jpeg image on canvas with mousewheel event in javascript
- UICollectionVIew zoom of a single UIImageView in a cell
- Zooming the ggplot or normal plot in R
- Graphic, zoom function
- how to maintain the location of a picturebox in the panel
Related Questions in SCALE
- Rotate & Scale a gif animation using 2 finger gesture in Android using Fresco Library
- ggplot arrangeGrob scale colour and size
- What technologies should I use to create a real time One to One chat?
- Responsive image scaling by the height of the window
- mongodb shard geo documents
- CSS :hover transform scale command rotate object instead
- How do I scale the graphics of a game?
- Modular Scale line-heights
- Android avoid image scalling in Imageview for Image Mapping like Html
- Corona using object.Xscale to flip an object will cause the object to look skewed when calling object:scale(x,y)
- Android : Zoom by center pinch
- Perform scale operation on QWidget and its children
- scale texture opengl 2
- gimp: resize and "unsharp mask" via script
- ggplot R scale x log10 limits not working
Related Questions in PINCH
- Pinch gesture on iPad Air 2 messes with Touch ID
- Multitouch - PointerIndex out of range
- How should I be scaling this map picture with UIPinchGestureRecognizer?
- Android ImageViewer class supporting Pinch-Zoom and Scrolling
- Pinch zoom not working in landscape mode when webview is not full screen
- iPhone google maps v3 pans after pinch zoom
- Pinch to Zoom Google Maps API v3 Android Webkit
- Pinch to Zoom not working in MapView when too small
- How to implement pinch-zoom feature for camera preview
- Zoom in an image with out loosing text resolution
- IndexPath of a cell when Pinches?
- Android: Scaling ImageView and it's onDraw() items
- PinthToZoom and Pan of UIView with multiple images
- Colorbox has a strange behavior when pinch to zoom-in on Ipad
- PhoneGap pinchzoom
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is an aproach without matrix, you can implement the pinch and zoom directly in the onDraw method. Check this blog post: http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html