¡@

Home 

2014/10/16 ¤W¤È 08:11:04

android Programming Glossary: canvas.setmatrix

Draw Rectangle Over ImageView for highlight that can be zoom in-out in android

http://stackoverflow.com/questions/10482229/draw-rectangle-over-imageview-for-highlight-that-can-be-zoom-in-out-in-android

canvas.drawRect rect_x1 30 rect_y1 30 rect_x1 30 rect_y1 30 myPaint mCanvasMatrix canvas.getMatrix mImageCanvas canvas canvas.setMatrix mCanvasMatrix canvas.restore UPDATE Below is my class used for ImageView pinch zoom. public class ImageViewScale extends.. 30 rect_y1 30 rect_x1 30 rect_y1 30 myPaint int canavs_width canvas.getWidth int canavs_height canvas.getHeight canvas.setMatrix mCanvasMatrix canvas.setMatrix mMatrix if mDrawable null mDrawable.draw canvas Log.v Log_tag draw with Canvas is done W.. rect_y1 30 myPaint int canavs_width canvas.getWidth int canavs_height canvas.getHeight canvas.setMatrix mCanvasMatrix canvas.setMatrix mMatrix if mDrawable null mDrawable.draw canvas Log.v Log_tag draw with Canvas is done W canavs_width H canavs_height ..

Android Image View Pinch Zooming

http://stackoverflow.com/questions/10630373/android-image-view-pinch-zooming

mPosX mPosY Matrix matrix new Matrix matrix.postScale mScaleFactor mScaleFactor pivotPointX pivotPointY canvas.setMatrix matrix canvas.drawBitmap BitmapDrawable this.getDrawable .getBitmap matrix null this.getDrawable .draw canvas canvas.restore..

Rotate View Hierarchy 90 degrees

http://stackoverflow.com/questions/3444764/rotate-view-hierarchy-90-degrees

canvas.scale scaleX scaleY getWidth 2 getHeight 2 mForward canvas.getMatrix mForward.invert mReverse canvas.save canvas.setMatrix mForward This is the matrix we need to use for proper positioning of touch events super.dispatchDraw canvas canvas.restore..

Layout with dynamic position

http://stackoverflow.com/questions/3683727/layout-with-dynamic-position

protected void onDraw Canvas canvas Log.e Drawing the postit Matrix matrix new Matrix matrix.postTranslate mX mY canvas.setMatrix matrix super.onDraw canvas @Override public void setContent Object content if content null content instanceof Content Content..