Package java.awt

Examples of java.awt.Graphics2D.clearRect()


       
        Polygon2D shape;
        int id;
       
        g.setBackground(this.backgroundColor);
        g.clearRect(0, 0, this.field.getWidth(), this.field.getHeight());

        double globalScale = this.globalScale();
        Polygon2D b = visibleBox.toPol2D();
        b.scale(Vector2D.NULL_VECTOR, new Vector2D(globalScale, globalScale));
        Vector2D midTranslation = new Vector2D(screenWidth / 2, screenHeight / 2);
View Full Code Here


        {
            retval = new BufferedImage( widthPx, heightPx, imageType );
        }
        Graphics2D graphics = (Graphics2D)retval.getGraphics();
        graphics.setBackground( TRANSPARENT_WHITE );
        graphics.clearRect( 0, 0, retval.getWidth(), retval.getHeight() );
        if (rotationAngle != 0)
        {
            int translateX = 0;
            int translateY = 0;
            switch(rotationAngle)
View Full Code Here

            bimg = new BufferedImage(400, 200, BufferedImage.TYPE_INT_RGB);
        }
       
        Graphics2D g2d = bimg.createGraphics();
        g2d.setBackground(Color.white);
        g2d.clearRect(0, 0, 400, 200);
        g2d.setColor(Color.black);
       
        //Paint something
        paintSome(g2d, pageNum);
       
View Full Code Here

            bimg = new BufferedImage(400, 200, BufferedImage.TYPE_INT_RGB);
        }
       
        Graphics2D g2d = bimg.createGraphics();
        g2d.setBackground(Color.white);
        g2d.clearRect(0, 0, 400, 200);
        g2d.setColor(Color.black);
       
        //Paint something
        paintSome(g2d, 1);
       
View Full Code Here

        BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
      Graphics2D g2D =
        environment.createGraphics(
          image);
        g2D.setBackground(new Color(0,0,0,0));
        g2D.clearRect(0,0,size,size);
        g2D.setStroke(new BasicStroke(1.5f));
        g2D.setRenderingHint(
          RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
        g2D.setColor(Color.black);
        g2D.drawLine(
View Full Code Here

        BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
      Graphics2D g2D =
        environment.createGraphics(
          image);
        g2D.setBackground(new Color(0,0,0,0));
        g2D.clearRect(0,0,size,size);
        g2D.setStroke(new BasicStroke(1.5f));
        g2D.setRenderingHint(
          RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
        g2D.setColor(Color.black);
        g2D.drawLine(
View Full Code Here

    MediaData paintData = (MediaData) data;
    BufferedImage img = new BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
    Graphics2D graphics2D = img.createGraphics();
    graphics2D.setBackground(paintData.getBackground());
    graphics2D.setColor(paintData.getDrawColor());
    graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
    graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
    graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
    graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
   
    ImageIO.write(img,"jpeg",out);
View Full Code Here

    MediaData paintData = (MediaData) data;
    BufferedImage img = new BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
    Graphics2D graphics2D = img.createGraphics();
    graphics2D.setBackground(paintData.getBackground());
    graphics2D.setColor(paintData.getDrawColor());
    graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
    graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
    graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
    graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
   
    ImageIO.write(img,"jpeg",out);
View Full Code Here

    while (running) {
      world.update(0.003f);
     
      Graphics2D g = (Graphics2D) buffer.getDrawGraphics();
     
      g.clearRect(0,0,getWidth(),getHeight());
      g.translate(getWidth()/2,getHeight()/2);
      g.scale(1,-1);
      for (int i=0;i<world.getBodyCount();i++) {
        drawBody(g, world.getBody(i));
      }
View Full Code Here

      BufferedImage bi = new BufferedImage(_width, _height,
          BufferedImage.TYPE_INT_RGB);

      Graphics2D g2 = bi.createGraphics();
      g2.setBackground(Color.BLACK);
      g2.clearRect(0, 0, _width, _height);
      g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
          RenderingHints.VALUE_ANTIALIAS_ON);

      // sets the color and stroke size and draws each ellipse
      for (int i = 0; i < ellipses.length; i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.