Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
276 views
Welcome To Ask or Share your Answers For Others

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...