O'Reilly logo

Pro Android Media: Developing Graphics, Music, Video, and Rich Media Apps for Smartphones and Tablets by Shawn Van Every

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Drawing a Bitmap onto a Bitmap

Before we get into the specific mechanisms used to alter the images, let's look at how we can create a new, empty Bitmap object and draw an existing Bitmap into that. This is the process that we will be using to create altered versions of our images.

In the foregoing example, we have a Bitmap object instantiated with an image that has been selected by the user. It has been instantiated by a call to BitmapFactory's decodeStream method, as we learned how to do in Chapter 1.

Bitmap bmp = BitmapFactory.decodeStream(getContentResolver().Image openInputStream(imageFileUri), null, bmpFactoryOptions);

In order to use this

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required