Package java.awt

Examples of java.awt.Graphics2D.clearRect()


  @Override
  public void fill_rect(int x, int y, int width, int height, de.yaams.rgssplayer.core.java.Color color) {
    Graphics2D g = (Graphics2D) this.data.getGraphics();
    g.setBackground(new java.awt.Color(0.0F, 0.0F, 0.0F, 0.0F));
    g.clearRect(x, y, width, height);

    if (color.alpha > 0.0D) {
      Composite c = null;
      if (color.alpha < 255.0D) {
        c = g.getComposite();
View Full Code Here


    if (this.cache != null && this.cache.getWidth() >= w && this.cache.getHeight() >= h) {
      Graphics2D g = (Graphics2D) this.cache.getGraphics();

      g.setBackground(new Color(0.0F, 0.0F, 0.0F, 0.0F));
      g.clearRect(0, 0, w, h);
    } else {
      this.cache = new BufferedImage(w, h, source.getType() == 0 ? 6 : source.getType());
    }

    int[] data = source.getRGB(0, 0, w, h, null, 0, source.getWidth());
View Full Code Here

        POLYGON_LIST = new ArrayList();
    }

    public void paint(Graphics graphics) {
        Graphics2D graphics2D = (Graphics2D) graphics;
        graphics2D.clearRect(0, 0, WIDTH, HEIGHT);
        for (int a = 0; a < POLYGON_LIST.size(); a++) {
            ((Polygon) POLYGON_LIST.get(a)).draw(graphics2D);
        }
        //border
        graphics2D.setPaint(Color.WHITE);
View Full Code Here

    Graphics2D graphics = image.createGraphics();

    // Background
    final Color background = new Color(226, 226, 222);
    graphics.setBackground(background);
    graphics.clearRect(0, 0, bounds.width, bounds.height);

    paintComponent(graphics);

    return image;
  }
View Full Code Here

                graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                        RenderingHints.VALUE_ANTIALIAS_OFF);
            }

            graphics.setBackground(new Color(0, 0, 0, 0));
            graphics.clearRect(0, 0, x, y);
            figure.paint(graphics);
            setImage(image);
        }
    }
}
View Full Code Here

        boolean isHeadless = Boolean.valueOf(System.getProperty("java.awt.headless", "false")).booleanValue();
        if (!isHeadless || JVM.is15()) {
            final BufferedImage image = new BufferedImage(3, 3, BufferedImage.TYPE_BYTE_BINARY);
            final Graphics2D graphics = image.createGraphics();
            graphics.setBackground(Color.WHITE);
            graphics.clearRect(0, 0, 2, 2);
            graphics.setColor(Color.BLACK);
            graphics.drawLine(0, 0, 2, 2);
   
            final ByteArrayOutputStream baosOriginal = new ByteArrayOutputStream();
            ImageIO.write(image, "tiff", baosOriginal);
View Full Code Here

        boolean isHeadless = Boolean.valueOf(System.getProperty("java.awt.headless", "false")).booleanValue();
        if (!isHeadless || JVM.is15()) {
            final BufferedImage image = new BufferedImage(3, 3, BufferedImage.TYPE_INT_ARGB);
            final Graphics2D graphics = image.createGraphics();
            graphics.setBackground(Color.WHITE);
            graphics.clearRect(0, 0, 2, 2);
            graphics.setColor(Color.RED);
            graphics.drawLine(0, 0, 2, 2);
   
            final ByteArrayOutputStream baosOriginal = new ByteArrayOutputStream();
            ImageIO.write(image, "png", baosOriginal);
View Full Code Here

     */
    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;
        g2.setBackground(og.getBackgroundColor());
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2.clearRect(3, 17, getWidth() - 6, getHeight() - 20);
        //pontos do arco a inserir
        Point2D.Double point1 = null;
        Point2D.Double point2 = null;

    double radius = og.getRadius();
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 (rotation != 0)
        {
            graphics.translate(retval.getWidth(), 0.0f);
            graphics.rotate(rotation);
        }
View Full Code Here

        Graphics2D graphics = image.createGraphics();

        // Background
        final Color background = new Color(226, 226, 222);
        graphics.setBackground(background);
        graphics.clearRect(0, 0, bounds.width, bounds.height);

        paintComponent(graphics);

        return image;
    }
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.