我在这个问题上使用了我的 Google-fu 无济于事。Camera
我的问题:我有一个 Android 应用程序,它使用下面的类在预览顶部覆盖一个椭圆EllipseView
:
public class EllipseView extends View {
private Paint paint = new Paint();
public EllipseView(Context context) {
super(context);
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(5.0f);
paint.setColor(Color.GREEN);
paint.setAlpha(0x60);
}
@Override
public void onDraw(Canvas canvas) {
Point canvasCenter = new Point(canvas.getWidth() / 2, canvas.getHeight() / 2);
RectF oval = new RectF(canvasCenter.x - 100, canvasCenter.y - 75, canvasCenter.x + 100, canvasCenter.y + 75);
canvas.drawOval(oval, paint);
canvas.drawCircle(canvasCenter.x, canvasCenter.y, 5, paint);
}
}
oval
是否可以在捕获的图片中找到相同的坐标?或者,我是否必须手动确定转换?