strBuff.append(LABEL_X);
strBuff.append(bitmapOrig.getHeight());
add(new LabelField(strBuff.toString()));
add(bitmapFieldOrig);
add(new SeparatorField());
// Display the scaled Bitmap on the screen
final BitmapField bitmapFieldScaled1 =
new BitmapField(bitmapScaled, Field.FOCUSABLE);
strBuff.delete(0, strBuff.length());
strBuff.append("\nScaled - ");
strBuff.append(bitmapScaled.getWidth());
strBuff.append(LABEL_X);
strBuff.append(bitmapScaled.getHeight());
strBuff.append(" - FILTER_LANCZOS - Aspect ratio not preserved");
add(new LabelField(strBuff.toString()));
add(bitmapFieldScaled1);
add(new SeparatorField());
// Redefine the scaled Bitmap
bitmapScaled =
new Bitmap(Bitmap.ROWWISE_32BIT_ARGB8888, scaledX, scaledY);
// Scale the original Bitmap into the new Bitmap using
// a bilinear filter and maintaining aspect ratio.
bitmapOrig.scaleInto(bitmapScaled, Bitmap.FILTER_BILINEAR,
Bitmap.SCALE_TO_FILL);
// Display the newly scaled Bitmap on the screen
final BitmapField bitmapFieldScaled2 =
new BitmapField(bitmapScaled, Field.FOCUSABLE);
strBuff.delete(0, strBuff.length());
strBuff.append("\nScaled - ");
strBuff.append(bitmapScaled.getWidth());
strBuff.append(LABEL_X);
strBuff.append(bitmapScaled.getHeight());
strBuff.append(" - FILTER_BILINEAR - Aspect ratio preserved");
add(new LabelField(strBuff.toString()));
add(bitmapFieldScaled2);
add(new SeparatorField());
// Redefine the scaled Bitmap
bitmapScaled =
new Bitmap(Bitmap.ROWWISE_32BIT_ARGB8888, scaledX, scaledY);