Frage

Ich bin in einer Bitmap-Zeichnung wie ..

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

Nun, wie auf Anti-Aliasing zu setzen, bevor g.drawLine ()?

War es hilfreich?

Lösung

Für die Anti-Aliasing-Modus verwenden public void setDrawingStyle (int DrawStyle, boolean auf)

Für Leitungen verwenden

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

Für poligons verwenden

graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, true);
graphics.drawRect(x, y, width, height);
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, false);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top