Canvas.drawBitmapMesh (Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, Paint paint)中的参数verts到底是什么意思?网上搜到说是像素新的位置,转移像素位置,但是到底转移哪个点的位置?
解决方案 »
- 弱弱的问一句,android 4.2.2的android:targetSdkVersion应该写17还是21呢?
- android 4.2.1 编译到最后不能打包是怎么回事
- 求助:android下如何调用邮件系统
- JDBC 连接 SQLite Error Out of memory
- 100分急救,http请求无响应,高手进
- 针对Android开发中Java语言的重点难点分享
- Android中怎么解析html字符串或页面
- android 蓝牙和wifi存在冲突
- handler获取到了子线程的值,怎么把这个值给json解析然后赋值给adapter,求大神帮忙。。贴图,难了几天。。。。。
- android创建数据库问题
- shell 读写文件的问题.
- 美图秀秀拼图效果是如何作的,大牛讲解一下思路呗!!!
public void drawBitmapMesh (Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, Paint paint) Since: API Level 1 Draw the bitmap through the mesh, where mesh vertices are evenly distributed across the bitmap. There are meshWidth+1 vertices across, and meshHeight+1 vertices down. The verts array is accessed in row-major order, so that the first meshWidth+1 vertices are distributed across the top of the bitmap from left to right. A more general version of this methid is drawVertices().Parameters
bitmap The bitmap to draw using the mesh
meshWidth The number of columns in the mesh. Nothing is drawn if this is 0
meshHeight The number of rows in the mesh. Nothing is drawn if this is 0 verts Array of x,y pairs, specifying where the mesh should be drawn. There must be at least (meshWidth+1) * (meshHeight+1) * 2 + meshOffset values in the array vertOffset Number of verts elements to skip before drawing
colors May be null. Specifies a color at each vertex, which is interpolated across the cell, and whose values are multiplied by the corresponding bitmap colors. If not null, there must be at least (meshWidth+1) * (meshHeight+1) + colorOffset values in the array.
colorOffset Number of color elements to skip before drawing
paint May be null. The paint used to draw the bitmap
相当于从原图里取出(meshWidth + 1) * (meshHeight + 1)个点放到verts中
参数里面没有体现初始位置,初始位置就是固定的,是把verts的点刚好铺在原图上对应的位置
新的像素位置就是verts,改变verts就能扭曲图片
比喻成皮肤,捏皮肤就能改变皮肤下面的东西