不能生成的纹理从位图 [英] Cannot Generate Texture From Bitmap
问题描述
我使用此时,floodFill
算法,以填补黑白画面与特定的颜色与用户触摸。
我用这个问题来使用的算法此时,floodFill:如何使用颜色填充算法Android的?
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?
问题是有时(乳清我想,以填补快)我得到无法生成的纹理从位图
错误和 mBitmap.getPixel(X,Y )
返回0和填充将停止!
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!
我可以使用 copyPixelsToBuffer(pictureBuffer)
而不是与getPixel()
法根据这一环节的最后一个职位: <一href=\"http://www.developpez.net/forums/d1338782/java/general-java/java-mobiles/android/openglrenderer-cannot-generate-texture-from-bitmap/\" rel=\"nofollow\">http://www.developpez.net/forums/d1338782/java/general-java/java-mobiles/android/openglrenderer-cannot-generate-texture-from-bitmap/
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/
但我不知道如何改变目前的code。
But i do not know How to Change current Code.
推荐答案
我解决了,根据Shubhadeep乔杜里回答以下链接:
I Solved that according to Shubhadeep Chaudhuri answer in below link :
有人移植J.邓拉普的队列线性洪水填充算法
这里的android。我试过它和它的pretty快。
Somebody ported J. Dunlap's Queue-Linear Flood Fill Algorithm to android here. I've tried it and it's pretty fast.
我修改了copyImage()方法最初利用的
类调用该作者没有提供工具。
I've modified the copyImage() method which originally makes use of a class called Utilities which the author hasn't provided.
http://stackoverflow.com/a/17426163/401403
这篇关于不能生成的纹理从位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!