【发布时间】:2012-02-08 19:31:13
【问题描述】:
基本上我可以使用 View 在 CameraPreview 上绘制一个简单的文本:
class DrawOnTop extends View {
public DrawOnTop(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.BLACK);
paint.setFakeBoldText(true);
canvas.drawText("Test Text",
30,
30, paint);
super.onDraw(canvas);
}
}
但我想在相机预览的底部添加“toast”之类的内容,而不是像这样的简单文本。我可以举个例子来说明我的意思,看看这张图片:
http://www.lemacinaie.it/amiata/wp-content/uploads/2011/07/realta_aumentata.jpg
我想实现同样的目标,我已经尝试过 opengles 没有成功......有人可以帮忙吗?谢谢。
编辑:我能够在 GLSurfaceView 中绑定相机预览,我只需要知道如何在 OpenGLES 中绘制一个带有文本的框,就像吐司一样。谢谢
【问题讨论】:
标签: android text opengl-es camera