Android:是否可以有多个单独的 Canvas 层,我可以将其合并为一个?
是否可以有多个单独的 Canvas 层,我可以将其合并到一?和我在 Photoshop 中做的类似吗?
更新:
一些解释为什么我想要这样的东西: Layer1
可能包含由复杂且 CPU 昂贵的算法创建的内容,而另一层 Layer2
则位于其之上,但会定期更改,例如,当用户触摸界面时。为此,我不想再次经历绘制底层 Layer1
的整个过程,而只需对 Layer2
进行更改,然后“合并”它们。
Is it possible to have multiple separate Canvas layers, which I can merge to one? Similar to what I'd do in photoshop?
Update:
Some explanation why I'd like to have something like that:Layer1
might hold something that has been created by a complex and CPU expensive algorithm while the other layer, Layer2
, is something that just goes on top of that, but changes regularly, e.g. when a user touches the interface. For that I don't want to go through the whole process of drawing the underlaying Layer1
again, but just make the changes to Layer2
and then "merge" them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,您可以拥有像 FrameLayout 这样的东西,在其中重写 onDraw() 并拥有服务器子元素,在其中也重写 onDraw()。
这可能会给您带来您想要的效果。
Well, you can have something like a FrameLayout in which you override onDraw() and have server sub-elements in which you also override onDraw().
This might give you the effect you want.