android自己写的类似刻度尺的东西(10)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
result = 0;
}
break;
}
}
initStaff();
canvas.drawBitmap(pointer, 143, 36, paint);
Paint reslutPaint = new Paint();
reslutPaint.setColor(Color.BLACK);
reslutPaint.setTextSize(RESULT_SIZE);
canvas.drawText(Float.toString(result) + " " + unit, RESULT_X, RESULT_Y, reslutPaint);
//解锁画布,提交画好的图像
mSurfaceHolder.unlockCanvasAndPost(canvas);
}
private void initStaff(){
int bx = initBx;
int num_x = num_left;
int mod = 0;
int midd = 2;
if(result != 0){
mod = (int)(Arithmetic.div(result, interval, 1) % 5);
bx += mod * move;
}
if(mod >= 3){
midd = 1;
num_x += (5 - mod) * move;
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>