Question

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.

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top