I'm having problems using Bitmap.createScaledBitmap in a custom widget's canvas in Android. The widget is supposed to display a scaled non anti-aliased version of the given resource.
There's the following code in the widgets class:
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Bitmap bmp = BitmapFactory.decodeResource(this.getResources(), R.drawable.btn);
bmp = Bitmap.createScaledBitmap(bmp, bmp.getWidth()*3, bmp.getHeight()*3, false);
canvas.drawBitmap(bmp, 0, 0, null);
}
The "false" parameter on createScaledBitmap is supposed to turn off anti-aliasing filtering. The result is scaled, but smooth. Changing the value to "true" makes no difference.
Is there another way to achieve the result I want?