开发学院手机开发Android 开发 在Android层实现触摸屏校验 阅读

在Android层实现触摸屏校验

 2010-05-31 14:35:00 来源:WEB开发网   
核心提示:Log.i("XXW prop", prop);Log.i("XXW", "prop.equalsIgnoreCase done");readCalibrate();SystemProperties.set("ts.config.calibrate&

Log.i("XXW prop", prop);

Log.i("XXW", "prop.equalsIgnoreCase done");

readCalibrate();

SystemProperties.set("ts.config.calibrate", "end");

}else{

Log.i("XXW prop", prop);

Log.i("XXW", "prop.equalsIgnoreCase else");

}

//edit ends

float scaledX = x;

float scaledY = y;

float temp;

float scaledPressure = 1.0f;

float scaledSize = 0;

int edgeFlags = 0;

if (isAbs) {

int w = display.getWidth()-1;

int h = display.getHeight()-1;

if (orientation == Surface.ROTATION_90

|| orientation == Surface.ROTATION_270) {

int tmp = w;

w = h;

h = tmp;

}

if (device.absX != null) {

//once edit

if (device.tInfo != null){

scaledX = (device.tInfo.x1 * x + device.tInfo.y1 * y + device.tInfo.z1)/ device.tInfo.s;

Log.i("XXW","x: "+x);

Log.i("XXW","trans x: "+scaledX);

}

else

//edit ends

scaledX = ((scaledX-device.absX.minValue)

/ device.absX.range) * w;

}

if (device.absY != null) {

//once edit

if (device.tInfo != null){

scaledY = (device.tInfo.x2 * x + device.tInfo.y2 * y + device.tInfo.z2) / device.tInfo.s;

Log.i("XXW","y: "+y);

Log.i("XXW","trans y: "+scaledY);

}

else

//edit ends

scaledY = ((scaledY-device.absY.minValue)

/ device.absY.range) * h;

}

if (device.absPressure != null) {

scaledPressure =

((pressure-device.absPressure.minValue)

/ (float)device.absPressure.range);

}

if (device.absSize != null) {

scaledSize =

((size-device.absSize.minValue)

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Android 实现 触摸屏

编辑录入:coldstar [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接