Android的:如何绘制简单的线条,并在小部件显示呢?并在、部件、线条、简单

2023-09-08 08:55:42 作者:天涯行客

我想通过绘制一些行用小部件可视化的东西。让刚刚说我得到两个坐标(x,y)的每n秒,然后要更新相应的部件。这工作就好了现在,但现在我想实际绘制这两点之间的直线。

i want to visualize stuff with a widget by drawing some lines. lets just say i get two coordinates (x,y) every n seconds and then want to update the widget accordingly. this works just fine by now, but now i want to actually DRAW a line between those two points.

我用Google搜索了一圈,发现很多东西,但没有解释的图像上绘图的基本原理。因为我有显卡没有经验,我想这些东西以某种方式工作像在LaTeX的tikzpicture绘制的图形。

i googled around and found many things, but nothing explaining the fundamentals of drawing on an image. since i have NO experience with graphics, i imagine these things to work somehow like graphics drawn with tikzpicture in LaTeX.

可有人请向我解释如何这所有的工作 - 或者至少指向我一个例子从一开始就解释这个?这将是非常美联社preciated!

can someone please explain to me the how this all works - or at least point me to an example explaining this from the start? it would be highly appreciated!

谢谢!

推荐答案

的 http://www.droidnova.com/playing-with-graphics-in-android-part-i,147.html

可以帮助一个开始。不幸的是,这仍然让我无能如何实际在小部件布局DRAW ...

may help for a start. unfortunately, this still leaves me clueless how to actually DRAW on a widgets layout...

...和我自己回答这个问题:android:如何自定义图像添加到小部件?

... and to answer this by myself: android: how to add a customized image to widgets?

 
精彩推荐
图片推荐