【问题标题】:android write text on image libraryandroid在图像库上写入文本
【发布时间】:2016-09-29 01:18:36
【问题描述】:

是否有任何库可以轻松地在图像的不同位置写入文本而无需执行大量数学运算?我需要在左上角的照片上写坐标。我现在看到的唯一方法是使用画布,但它需要计算坐标、字体大小和其他东西。谢谢。

【问题讨论】:

    标签: android graphics fonts


    【解决方案1】:

    尝试关注

    Bitmap bitmap = ... // Load your bitmap here
    Canvas canvas = new Canvas(bitmap);
    Paint paint = new Paint(); 
    paint.setColor(Color.BLACK); 
    paint.setTextSize(10); 
    canvas.drawText("Some Text here", x, y, paint);
    

    This 会帮助你

    【讨论】:

    • 我在帖子中写过这种方式,这需要计算字体、坐标等。我在询问可以帮助简化此操作的库
    • 得到了任何解决方案。有图书馆吗?
    猜你喜欢
    • 1970-01-01
    • 2010-09-26
    • 1970-01-01
    • 2016-05-14
    • 2011-10-13
    • 2016-10-20
    • 1970-01-01
    • 2016-03-30
    • 1970-01-01
    相关资源
    最近更新 更多