views:

278

answers:

1

I m drawing in a bitmap like..

bitmap[i] = new Bitmap(60, 60);  
Graphics g = new Graphics(bitmap[i]);
g.setColor(Color.BLACK);
g.drawLine(....);

Now how to set Anti-Aliasing on before g.drawLine()?

+1  A: 

For antialiasing mode use public void setDrawingStyle(int drawStyle, boolean on)

For lines use

graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, true);
graphics.drawLine(x1, y1, x2, y2);
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, false);

For poligons use

graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, true);
graphics.drawRect(x, y, width, height);
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, false);
Max Gontar
Thanks.. I cant see its effect in Simulator. I will test it on Storm.
Shreyas