获取圆的像素
是否有一个形状或 shapedrawable 对象我可以使用它(或任何对象),给我一个圆圈,可以完全控制视图中 ondraw() 内的像素?我想要做的是在位图上放置一个清晰的圆圈,然后操作它的像素。
谢谢垫子
is there an shape or shapedrawable object i can use that(or any object), give me a circle with full control over it's pixels within the ondraw() in a view? What i'm wanting to do is place a clear circle over a bitmap then mnipulate it's pixels.
thanks mat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里最好的解决方案是创建一个自定义视图,然后不依赖内置绘图,而是在 onDraw 方法中完整地绘制所有内容。 onDraw 对于在视图之上绘制额外的内容非常有用——您无法轻易删除已经在视图上绘制的内容。只需对您自己的视图进行子类化,然后传入您想要绘制的位图并从那里开始即可。祝你好运!
The best solution here would be to create a custom view, and then rather than relying on the built-in drawing, just draw everything in its entirety in the onDraw method. onDraw is useful for drawing extra stuff on top of a view--you can't easily get rid of what is already being drawn there. Just subclass a view all your own, and pass in the bitmap you want to draw and go from there. Good luck!