绘制到一个ImageView的 [英] Draw onto an ImageView

查看:144
本文介绍了绘制到一个ImageView的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我研究了Androidreference几个小时了,但没有真正得到线索如何绘制一个ImageView的东西(文本,位图,路径....)。

I studied the Androidreference for hours now, but don't really get the clue how to draw something (Text, Bitmap, Path ....) on a ImageView.

我应该扩展查看和使用的onDraw() - 方法?如果是的话,我怎么能吸取我的ImageView?

Should I extend View and use the onDraw()-Method? If yes, how can I draw on my ImageView?

或者是有其他的方式来实现我的目标?

Or is there any other way to achieve my goal?

推荐答案

如果你只是想画上你的ImageView另一个位图,它不应该是动态的,不是使用AbsoluteLayout及以上互相它们的位置。

If you just want to draw another bitmap on your ImageView and it shouldn't be dynamic, than use AbsoluteLayout and position them above each other.

如果它应该是更加动态,笔者推荐使用SurfaceView。该教程可以在这里找到:的http:// www.droidnova.com/playing-with-graphics-in-android-part-i,147.html

If it should be much more dynamic, I recommend to use a SurfaceView. A tutorial can be found here: http://www.droidnova.com/playing-with-graphics-in-android-part-i,147.html

(目前仅通过在线webarchive:的http://web.archive.org/web/20121005111921/http://www.droidnova.com/2d-tutorial-series)

(currently only online via webarchive: http://web.archive.org/web/20121005111921/http://www.droidnova.com/2d-tutorial-series)

这篇关于绘制到一个ImageView的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆