Cannot Generate Texture From Bitmap

佐手、 提交于 2019-12-13 08:23:06

问题


I am using floodfill algorithm to fill a black white picture with specific color with user touches. I used this Question to use floodfill algorithm : How to use flood fill algorithm in Android?

the problem is sometime(whey i want to fill fast) I get Cannot Generate Texture From Bitmap error and mBitmap.getPixel(x, y) returns 0 and filling will be stop!

I can use copyPixelsToBuffer ( pictureBuffer ) instead of getPixel() method According to last post of this link : http://www.developpez.net/forums/d1338782/java/general-java/java-mobiles/android/openglrenderer-cannot-generate-texture-from-bitmap/

But i do not know How to Change current Code.


回答1:


I Solved that according to Shubhadeep Chaudhuri answer in below link :

Somebody ported J. Dunlap's Queue-Linear Flood Fill Algorithm to android here. I've tried it and it's pretty fast.

I've modified the copyImage() method which originally makes use of a class called Utilities which the author hasn't provided.

https://stackoverflow.com/a/17426163/401403



来源:https://stackoverflow.com/questions/21364736/cannot-generate-texture-from-bitmap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!