Smoothing

From Progzoo
Jump to: navigation, search

We can improve our images by smoothing. This reduces the ugly "pixelated" quality of the images.

Smoothing

DrawSmooth.png

The first line is drawn without smoothing, the second is smoothed.

We set the smoothing on - after this all the drawing operations are slower, but better.


See http://java.sun.com/j2se/1.5.0/docs/api/java/awt/RenderingHints.html for the bewildering variety of options available.

g.setRenderingHint(
   RenderingHints.KEY_ANTIALIASING,
   RenderingHints.VALUE_ANTIALIAS_ON);



[Font] [Default] [Show] [Resize] [History] [Profile]