Android animated pixelation

802 views Asked by At

I'm working on a game that obscures part of image, player then guesses what's hidden and finally the obscured part is revealed, so player can see if he guessed correctly.

At the moment I just draw a black box above the obscured part, but it would be nice if I could pixelate the obscured area to a huge pixel size, then decrease the pixelation size until the image is clearly visible, in an animation.

Is it possible to somehow utilize Android's support for animations (I have used it in one game, to animate on screen stuff), or would I need to implement this entirely on my own using some kind of timer and drawing on Canvas myself? Or is there something handy that will help me?

1

There are 1 answers

2
Nathan Fig On BEST ANSWER

Hint for a possible solution: use BitmapFactory to get a sample of your image that's smaller than the original, and blow it up to create a "pixelated" version. See: http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inSampleSize