我正在绘制像...这样的位图。
bitmap[i] = new Bitmap(60, 60);
Graphics g = new Graphics(bitmap[i]);
g.setColor(Color.BLACK);
g.drawLine(....);
现在如何在g.drawLine()之前设置Anti-Aliasing?
答案 0 :(得分:3)
对于抗锯齿模式,请使用public void setDrawingStyle(int drawStyle, boolean on)
对于线路使用
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, true);
graphics.drawLine(x1, y1, x2, y2);
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, false);
对于poligons使用
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, true);
graphics.drawRect(x, y, width, height);
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, false);