在我的应用程序中,绘制的位图好像颜色是某种较低质量的类型。如果我使用图库应用程序加载背景图像,它加载得很好,看起来不像是超低质量。我用来加载和绘制图像的代码很简单:
//Code for initializing the Bitmap
Bitmap bitmap = Bitmap.createScaledBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.none), (int) (canvas.getWidth() * compression), (int) (canvas.getHeight() * compression), true);
//...
//Code for drawing this Bitmap
canvas.drawBitmap(bitmap, null, new RectF(0, 0, canvas.getWidth(), canvas.getHeight()), null);
如果代码中没有任何内容告诉您出了什么问题,我制作了一张图像,比较了图像在计算机或其他图像查看器上的实际外观,以及它在应用程序中的外观。