文章分类 - Android 绘图
摘要:高斯模糊高斯模糊就是将指定像素变换为其与周边像素加权平均后的值,权重就是高斯分布函数计算出来的值。一种实现点击打开链接=0&&k>16;intcg=(color&0x0000ff00)>>8;intcb=(color&0x000000ff);r+=cr*gaussMatrix[j+radius];g...
阅读全文
摘要:由于在网络上找到关于Canvas的使用都比较抽象,也许是我的逻辑思维不太好吧,总是感觉理解起来比较困难, 尤其是对save()和restore()方法的使用。本篇文章的内容就是对Canvas的使用进行一下总结,包括它的两种不同的使用 情节和它的一些方法进行一下说明。1Bitmap,可以来自资源/文件...
阅读全文
摘要:下面给一个Android 设备LCD触控识别度测试,也是过去看过美国一个客户的设备是如此检测,这里给出一个近似的demo:里面需要注意两个地方:其中 40是设置绘制框型的边长,这个可以自行设置;另外一个72是Y轴的校验值,即去掉标题栏,如果隐藏标题栏,就不需要将当前获得的值mGetY减去72了.再就是android:左右是X方向,上下是Y方向,默认左上角是坐标[0,0],不设置相对坐标就不可能又负值.package com.example.testsurfaceviewactivity;import android.annotation.SuppressLint;import android.
阅读全文
摘要:package com.example.testsurfaceviewactivity;import java.lang.reflect.Field;import java.util.ArrayList;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import an
阅读全文
摘要:1、首先说一下canvas类:Class OverviewThe Canvas class holds the "draw" calls. To draw something, you need 4 basic components: A Bitmap to hold the pixels, a Canvas to host the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect, Path, text, Bitmap), and a paint (to describe the co
阅读全文
摘要:1、首先说一下两个类:MatrixClass OverviewThe 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.).矩阵类拥有
阅读全文