设为首页 加入收藏

TOP

Android实现图片顺时逆时旋转及拖拽显示效果
2014-11-24 14:34:38 来源: 作者: 【 】 浏览:2
Tags:Android 实现 图片 顺时 旋转 显示 效果

1、首先说一下两个类:




The Matrix class holds a 3x3 matrix for transforming coordinates. Matrix does not have a constructor, so it must be explicitly initialized using either reset() - to construct an identity matrix, or one of the set..() functions (e.g. setTranslate, setRotate, etc.).


接下来我们用到了两个方法:


平移方法:两个参数分别是要移到的x、y坐标








PointF holds two float coordinates


我们要用到该类的一个方法:设置点的x和y坐标




首先看一下效果图:


旋转拖拽后


布局很简单在此不再给出!直接看java代码:





Interface definition for a callback to be invoked when a touch event is dispatched to this view. The callback will be invoked before the touch event is given to the view.


接口定义作为一个回调函数被调用时被派遣去触摸事件这一观点。回调函数被调用之前会触摸事件是给你尽情的观看。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Android中资源文件assets和res下.. 下一篇Android动画Animation之Frame实现..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: