android 画布连接
我试图通过读取数组并使用大小写开关来构建画布来构建 SurfaceView。
所以问题是:我可以通过跟踪 X 来构建循环 Y 的画布吗?使用 BitmapFactory() 将位图加载到画布中,然后使用 1 .show() 将画布渲染到屏幕上?或者我是否需要为每一个调用画布渲染(或者每次我这样做时都会穿过屏幕)?
I am trying to construct a SurfaceView by reading in an array and using case switches to build the canvas.
so the question is: can I construct a canvas looping Y, by tracking X. loading bitmaps using BitmapFactory() into the canvas and then using 1 .show() to render the canvas to the screen? or will I need to call the canvas render for each of these (or will that through away the screen every time I do that)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定您的意思,但有一点是避免在
onDraw
中使用BitmapFactory
。您不希望在渲染的同时进行位图解码。您应该提前加载位图并将它们保留在内存中以便以后更快地绘制。Not sure what you're getting at, but for one thing avoid using
BitmapFactory
inonDraw
. You don't want to be doing bitmap decoding at the same time as rendering. You should load your bitmaps ahead of time and keep them around in memory for faster drawing later on.