Bitmap scaling sample app
The bitmap scaling sample application demonstrates how to scale the size of a Bitmap image.
The sample application demostrates how to scale an original Bitmap image into new Bitmap objects, how to apply filters that help reduce the pixelated appearance of a scaled Bitmap image, and how to preserve the aspect ratio of the image.
This sample features the following classes:
This class represents a Bitmap image that can be displayed on the BlackBerry device. The Bitmap class provides the scaleInto() method that scales the Bitmap image and stores the scaled image in the Bitmap object that is passed in as a parameter. The scaleInto() method takes parameters that you can use to preserve the aspect ratio of the image, and specify filters to reduce the pixelation of the scaled image.
The sample application uses the scaleInto() method to create scaled Bitmap images with different filters and aspect ratios.
Install the sample app
Visit www.blackberry.com/go/bitmapscalingsample to download the sample application.
Extract the bitmapscalingdemo.zip file.
On the taskbar, click Start > Programs > Research In Motion > BlackBerry JDE 5.0 > JDE.
Open the workspace that you want to add the sample application to.
In the workspace tree, right-click the project that you want to add the sample application to.
Click Add project to <workspace folder>.
In the Add project to <workspace> dialog box, navigate to the folder where you extracted the sample application.
Click the BitmapScalingDemo.jdp file.
The sample app is also available in github.
Run the sample app
In the workspace where you added the bitmapscalingdemo project, right-click bitmapscalingdemo.
Click Build project.
On the taskbar, click Start > Applications > Research in Motion > BlackBerry JDE 5.0 > Device Simulator.
On the Home screen of the BlackBerry Smartphone Simulator click the Downloads folder.
Click the Bitmap Scaling Demo icon.