Comment mettre Anti Aliasing dans Blackberry Storm?
-
20-09-2019 - |
Question
I m dessin dans un bitmap comme ..
bitmap[i] = new Bitmap(60, 60);
Graphics g = new Graphics(bitmap[i]);
g.setColor(Color.BLACK);
g.drawLine(....);
Maintenant, comment mettre anticrénelage avant de g.drawLine ()?
La solution
Pour le mode anticrénelage utilisation setDrawingStyle public void (int DrawStyle, boolean on)
Pour les lignes utilisent
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, true);
graphics.drawLine(x1, y1, x2, y2);
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, false);
Pour utiliser poligons
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, true);
graphics.drawRect(x, y, width, height);
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, false);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow