绘制一个大的位图背景SurfaceView的Andr​​oid位图、背景、SurfaceView、Andr

由网友(一见钟情不将就)分享简介:我试图找到最好的方式(preformance明智)绘制一个大的位图到 SurfaceView 在Android作为一个固定的背景图像。我目前只使用 Canvas.drawBitmap()方法,但它受到了很多我带来了FPS下降。什么是一些我可以加快这方面?I am trying to find the best way...

我试图找到最好的方式(preformance明智)绘制一个大的位图 SurfaceView 在Android作为一个固定的背景图像。我目前只使用 Canvas.drawBitmap()方法,但它受到了很多我带来了FPS下降。什么是一些我可以加快这方面?

I am trying to find the best way (preformance-wise) to draw a large Bitmap to a SurfaceView in Android as a stationary background image. I am currently just using the Canvas.drawBitmap() method but it brings my FPS down by a lot. What are some ways that I can speed this up?

推荐答案

尝试使用不透明图像,并设置Xfermode上油漆null或PorterDuff.Mode.SRC。这将禁用混合可以是昂贵的。此外,还应确保图像不拉伸(无缩放),它是在相同的格式surfaceview表面。

Try to use an opaque image and set the Xfermode on the Paint to either null or PorterDuff.Mode.SRC. This will disable blending which can be expensive. Also make sure your image is not stretched (no scaling) and that it's in the same format as the surfaceview's surface.

阅读全文

相关推荐

最新文章