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()?
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()?
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);
DRAWSTYLE_AAPOLYGONS
also applies to circles and ellipses. Its effect is perceptible in simulators, but you'll probably need to increase zoom to 4x. –
Aponte © 2022 - 2024 — McMap. All rights reserved.