draw text on top of bitmap failed

↘锁芯ラ 提交于 2019-12-05 04:33:33

What do you do with the canvas? Where is it used? (post some more code...)

Beside that the drawing order is wrong, you are overdrawing your text and point with the bitmap.

Edit:

I am a bit lost as I don't know which of your images should be the background and what image you already see... so i am guessing that mBitmap (the roomplan) is your background? Than add that to your layout as a background image and just use the ImageView to draw your overlay...

if your Overlay need a background image too, try that:

// overlay background
canvas.drawBitmap(myBmp, 0, 0, paint);
// draw the text and the point
canvas.drawText("You are here", 100, 100, paint);
canvas.drawPoint(30.0f, 50.0f, paint);

If your ImageView should have the roomplan as a background, try that:

// overlay background
canvas.drawBitmap(mBitmap, 0, 0, paint);
// draw the text and the point
canvas.drawText("You are here", 100, 100, paint);
canvas.drawPoint(30.0f, 50.0f, paint);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!