开发者

Filter Bitmap Flag is not working!

I have a simple code that rotates a canvas with a bitmap. The results are obviously jagged, so I enabled filtering and aliasing. The problem is, these flags are not working!

Here is my code:

Rect rect = new Rect(10,10,130,90);
Rect whiteRect = new Rect(9,9,131,91);

Paint paint = new Paint();
paint.setFilterBitmap(true);
paint.setAntiAlias(true);

canvas.save();
canvas.rotate(9, 60, 40);
canvas.drawRect(whiteRect, whitePaint);
canvas.drawBitmap(thumbs.get(1), null, rect, paint);
canvas.restore();

Here on this example, filterBitmap isn't doing nothing, and aliasing is working but doesn't solve the problem, just make it a little bit "less ugly"..

Any ideas on what I'm doing wrong?开发者_StackOverflow This is a custom View's onDraw method..

EDIT: I'm testing on Android 2.2 on a Galaxy Tab


Try:

Paint paint = new Paint(); paint.setFlags(Paint.FILTER_BITMAP_FLAG | Paint.ANTI_ALIAS_FLAG);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜