使用Android画布绘制命令:Android,线宽,像素尺寸
如果我设置stroke = 0或stroke = 1并绘制水平线,则线条像素为两个像素高。如果我设置stroke = 2,像素也是两个像素高但更亮。
如果我绘制单个像素,像素是一个2x2矩阵,笔画= 0或笔画= 1。如果笔画= 2,我也得到一个2x2矩阵,但有更明亮的像素。
我必须做些什么来获得只有一个像素高的线? 我必须做些什么才能获得只有一个像素的像素?
注意:正在使用的设备的屏幕尺寸为480 x 800或更大。
Paint thePaint = new Paint();
thePaint.setARGB(a, r, g, b);
thePaint.setAntiAlias(true);
thePaint.setStyle(Paint.Style.FILL);
thePaint.setStrokeWidth(0);
canvas.drawLine(x1,y1,x2,y2, thePaint);
根据文档,strokeWidth为0应该是1像素,不管是什么......您能否提供一些代码来显示您如何创建Paint对象以及如何绘制到Canvas? – 2012-07-24 01:26:59
已添加代码。是的,这就是文档所说的。这不是现实。 – Xarph 2012-07-24 03:09:59