android Programming Glossary: scaley
Canvas Pinch-Zoom to Point Within Bounds http://stackoverflow.com/questions/11339190/canvas-pinch-zoom-to-point-within-bounds float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale.. scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale..
Android Gallery zoom in/out http://stackoverflow.com/questions/11468536/android-gallery-zoom-in-out g scaleX zoom ObjectAnimator.ofFloat g scaleY zoom set.addListener new AnimatorListener @Override public void..
Android Pinch and Zoom Image in Activity http://stackoverflow.com/questions/13210443/android-pinch-and-zoom-image-in-activity float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale.. scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale..
Rotate View Hierarchy 90 degrees http://stackoverflow.com/questions/3444764/rotate-view-hierarchy-90-degrees what I want. float scaleX float getHeight getWidth float scaleY float getWidth getHeight canvas.scale scaleX scaleY getWidth.. float scaleY float getWidth getHeight canvas.scale scaleX scaleY getWidth 2 getHeight 2 mForward canvas.getMatrix mForward.invert..
Sideways View with XML Android http://stackoverflow.com/questions/3774770/sideways-view-with-xml-android rotation there is rotationX rotationY pivotX pivotY scaleX scaleY and translationX translationY. I haven't played with any of..
Trying to get the display size of an image in an ImageView http://stackoverflow.com/questions/3855218/trying-to-get-the-display-size-of-an-image-in-an-imageview using the constants if aspect ratio maintained scaleX scaleY final float scaleX f Matrix.MSCALE_X final float scaleY f Matrix.MSCALE_Y.. scaleY final float scaleX f Matrix.MSCALE_X final float scaleY f Matrix.MSCALE_Y Get the drawable could also get the bitmap.. Math.round origW scaleX final int actH Math.round origH scaleY Log.e DBG origW origH actW actH scales x scaleX y scaleY Note..
Android image view matrix scale + translate http://stackoverflow.com/questions/6075363/android-image-view-matrix-scale-translate float scaleX float displayWidth float imageWidth float scaleY float displayHeight float imageHeight float minScale Math.min.. float imageHeight float minScale Math.min scaleX scaleY tx ty should be the translation to take the image back to the..
Android Bitmap/Canvas offset after scale http://stackoverflow.com/questions/6835224/android-bitmap-canvas-offset-after-scale to work out the best formula for this canvas.scale scaleX scaleY pivotX pivotY if scaleX 1 objectNewX objectOldX objectOldX pivotX..
How do I modify TouchImageView with double tap to zoom in and out? http://stackoverflow.com/questions/7704086/how-do-i-modify-touchimageview-with-double-tap-to-zoom-in-and-out float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale.. scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale..
Canvas Pinch-Zoom to Point Within Bounds http://stackoverflow.com/questions/11339190/canvas-pinch-zoom-to-point-within-bounds Change this according to your screen size Fit to screen. float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale 1f.. float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale 1f scaleMappingRatio saveScale scale Center the image redundantYSpace..
Android Gallery zoom in/out http://stackoverflow.com/questions/11468536/android-gallery-zoom-in-out AnimatorSet set new AnimatorSet set.playTogether ObjectAnimator.ofFloat g scaleX zoom ObjectAnimator.ofFloat g scaleY zoom set.addListener new AnimatorListener @Override public void onAnimationStart Animator animation @Override public void..
Android Pinch and Zoom Image in Activity http://stackoverflow.com/questions/13210443/android-pinch-and-zoom-image-in-activity height MeasureSpec.getSize heightMeasureSpec Fit to screen. float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale 1f.. float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale 1f Center the image redundantYSpace float height scale float..
Rotate View Hierarchy 90 degrees http://stackoverflow.com/questions/3444764/rotate-view-hierarchy-90-degrees the canvas to accommodate the new screen size. This is not what I want. float scaleX float getHeight getWidth float scaleY float getWidth getHeight canvas.scale scaleX scaleY getWidth 2 getHeight 2 mForward canvas.getMatrix mForward.invert mReverse.. is not what I want. float scaleX float getHeight getWidth float scaleY float getWidth getHeight canvas.scale scaleX scaleY getWidth 2 getHeight 2 mForward canvas.getMatrix mForward.invert mReverse canvas.save canvas.setMatrix mForward This is..
Sideways View with XML Android http://stackoverflow.com/questions/3774770/sideways-view-with-xml-android 11 which tweaks this property from code. And in addition to rotation there is rotationX rotationY pivotX pivotY scaleX scaleY and translationX translationY. I haven't played with any of them yet. There is a list of all the changes in API 11 . But..
Trying to get the display size of an image in an ImageView http://stackoverflow.com/questions/3855218/trying-to-get-the-display-size-of-an-image-in-an-imageview new float 9 getImageMatrix .getValues f Extract the scale values using the constants if aspect ratio maintained scaleX scaleY final float scaleX f Matrix.MSCALE_X final float scaleY f Matrix.MSCALE_Y Get the drawable could also get the bitmap behind.. values using the constants if aspect ratio maintained scaleX scaleY final float scaleX f Matrix.MSCALE_X final float scaleY f Matrix.MSCALE_Y Get the drawable could also get the bitmap behind the drawable and getWidth getHeight final Drawable d.. Calculate the actual dimensions final int actW Math.round origW scaleX final int actH Math.round origH scaleY Log.e DBG origW origH actW actH scales x scaleX y scaleY Note To get the image transformation Matrix from code in general..
Android image view matrix scale + translate http://stackoverflow.com/questions/6075363/android-image-view-matrix-scale-translate . Here is the code Compute the scale to choose this works float scaleX float displayWidth float imageWidth float scaleY float displayHeight float imageHeight float minScale Math.min scaleX scaleY tx ty should be the translation to take the.. float displayWidth float imageWidth float scaleY float displayHeight float imageHeight float minScale Math.min scaleX scaleY tx ty should be the translation to take the image back to the screen center float tx Math.max 0 0.5f float displayWidth..
Android Bitmap/Canvas offset after scale http://stackoverflow.com/questions/6835224/android-bitmap-canvas-offset-after-scale android canvas share improve this question Ok lets try to work out the best formula for this canvas.scale scaleX scaleY pivotX pivotY if scaleX 1 objectNewX objectOldX objectOldX pivotX scaleX 1 else objectNewX objectOldX objectOldX pivotX..
How do I modify TouchImageView with double tap to zoom in and out? http://stackoverflow.com/questions/7704086/how-do-i-modify-touchimageview-with-double-tap-to-zoom-in-and-out height MeasureSpec.getSize heightMeasureSpec Fit to screen. float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale 1f.. float scale float scaleX float width float bmWidth float scaleY float height float bmHeight scale Math.min scaleX scaleY matrix.setScale scale scale setImageMatrix matrix saveScale 1f Center the image redundantYSpace float height scale float..
|