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 answers
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in VIEW
- Opening sheet in SwiftUI view
- Get json field value in sqlite model from view django
- I don't understand which databases are invalid
- View is not refreshing
- Changes to my model/viewmodel are not charging what's on my view
- How to create a text sticker view in swift, like in Canva App, which is resizable as per the text content in it
- SQL Tranformations in view or stored procedure?
- SQL query getting too slowly when using IIF in a view column that is using aggregate results from a previous view. see below example for a clarity
- How to add focus in AndroidView field
- Angular 17 does not update view using setInterval with NG0500 error in console
- How to use std::ranges::set_symmetric_difference over a non sorted range?
- AUTH_USER_MODEL refers to model 'Socialmedia.User' that has not been installed
- Is it possible to show columns really used in a view
- Can't render views of html in django
- Entity Framework Core add relationship between view and standard model objects
Related Questions in ZOOMING
- Why is the zoom feature of my game in pygame not working?
- OpenLayers: Zoom level cropping VectorTile layer - how to fix?
- mapView.fitToBounds() method from highcharts not working
- Zoom Web SDK - "Invalid apiKey/sdkKey and/or signature"
- React zooming and dragging image
- Using SciPy ndimage.zoom on an array with nan values
- Removing blurred mathematical expressions into a PDF file and make it vectorized when zooming
- UIScrollView is unexpectedly initially zoomed in in UIViewControllerRepresentable
- Zooming into defs in force-directed graphs
- Layout breaks on zoom in with "cmd +" but not with zoom in with mousepad
- Image not being dragged correctly when zoomed in
- Prevent shiny reactivity to re-render a plot when zooming the screen
- d3 zoomable circle packaging broken zoom
- App with Imageview scale in Android Studio emulator Small Device breaks without error
- Resolving Coordinate Misalignment in Zoomable PictureBox
Related Questions in SCALE
- I need an azure product that executes my intensive ffmpeg command then dies, and i only get charged for the delta. Any Tips?
- Merge Azure mp4 blobs via API (Preferred Azure)
- Colorbar and contour plot seem to not match data; individual/custom scale to emphasize data of interest
- Weight measurement with real-time time stamping using the Kern KB 3600-2N precision balance
- Highcharts Spider Chart with different scale for each category
- GKE cluster shutdown
- Prevent blocking the event loop on sync operations
- How to keep original x-axis after utilizing a custom scaling for the geom_rect in ggplot?
- ESP32 attachInterrupt causing (Interrupt wdt timeout on CPU1)
- How to fix SVG being cut off when using as background?
- How to move the background image by clicking and dragging the mouse smoothly?
- How to use pyplot to show data with no scale on xaxis and allow to pan (shift) via mouse
- Page scales down on mobile when width is below 980px
- signalr - programatically scaling up (from azure function)
- Getting scale offset inside tkinter canvas
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
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?
Popular Tags
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)
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