How to set Anti Aliasing in Blackberry Storm?
Asked Answered
D

1

2

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()?

Durno answered 29/8, 2009 at 4:15 Comment(0)
E
3

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);
Extirpate answered 30/8, 2009 at 6:53 Comment(2)
Thanks.. I cant see its effect in Simulator. I will test it on Storm.Durno
The flag 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.