tuxmartin

JAVA Graphics2D ANTIALIASING (FimUTILS)

Dec 8th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics2D;
  3. import java.awt.RenderingHints;
  4. import fim.utils.Application;
  5. import fim.utils.Console;
  6.  
  7. @SuppressWarnings("serial")
  8. public class Antialiasing extends Application {
  9.  
  10.     public void start() {
  11.         out.switchView(Console.VIEW_GRAPH);
  12.        
  13.         //misto :
  14.         img.getGraphics().drawLine(100, 100, 200, 250);
  15.        
  16.         Graphics2D g = (Graphics2D) img.getGraphics();
  17.         g.setColor(Color.WHITE);
  18.         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  19.        
  20.         // to kreslis:
  21.         g.drawLine(150, 150, 250, 300);
  22.        
  23.     }
  24.  
  25.     public static void main(String[] args) {
  26.         new Antialiasing().start();
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment