I want to create a Fractal generator for Android.
The only unclear thing I have in my list is: which class should I use, in order to display the result on the screen? I need to have something like a bitmap, to be able to get the current width / height and to be able to set some pixels (RGB), without having every pixel to be a different object.
I saw I can use the Bitmap class, but I am not sure if this is the right way.
As an extra, I also want to be able to set the generated screen to the background and save the result to a file.
Which class I should use for this?
You can use canvas.drawPoint()
:
To draw something, you need 4 basic components: A Bitmap to hold the pixels, a Canvas to host the draw calls (writing into the bitmap), a drawing primitive (e.g. Rect, Path, text, Bitmap), and a paint (to describe the colors and styles for the drawing).
For reference: http://developer.android.com/reference/android/graphics/Canvas.html#drawPoint(float,%20float,%20android.graphics.Paint)