Package java.awt

Examples of java.awt.Graphics.dispose()


    final Graphics graphics = gfx.create();
    graphics.setColor(value);
    graphics.fillRect(box.x, box.y, box.width, box.height);
    graphics.setColor(Color.BLACK);
    graphics.drawRect(box.x, box.y, box.width, box.height);
    graphics.dispose();
  }

  public String getJavaInitializationString()
  {
    return null;
View Full Code Here


      }

      painting = false;
    }

    og.dispose();

    // finally draw it all centred
    g.drawImage(offscreen, (getWidth() - offscreen.getWidth(null))/2, (getHeight() - offscreen.getHeight(null))/2, null);
  }
View Full Code Here

        g.drawImage(logoBuffer, progressbar.getWidth(null)/2-logo.getWidth(null)/2,
                    progressbar.getHeight(null)/2-logo.getHeight(null)/2, null);
      }

      g.drawImage(img, 0, 0, this);
      g.dispose();

      repaint();
    }

    return true;
View Full Code Here

        // images and the paint it on top of a new BufferedImage
        Image img = new ImageIcon(url).getImage();
        BufferedImage bufferedImage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
        Graphics g = bufferedImage.getGraphics();
        g.drawImage(img, 0, 0, null);
        g.dispose();

        return bufferedImage;
    }
}
View Full Code Here

    final BufferedImage mask = new BufferedImage(img.getWidth(observer), img.getHeight(observer),
        BufferedImage.TYPE_BYTE_BINARY);
    final Graphics g = mask.getGraphics();
    g.fillRect(sx1, sy1, (int) swidth, (int) sheight);
    drawImage(img, mask, tx, null, observer);
    g.dispose();
    return true;
  }

  /**
   * @see Graphics#dispose()
View Full Code Here

        BufferedImage bi = gc.createCompatibleImage(w, h, Transparency.TRANSLUCENT);
       
        Graphics g = bi.createGraphics();
        DcSwingUtilities.setRenderingHint(g);
        g.drawImage(image, 0, 0, w, h, null);
        g.dispose();
       
        bi.flush();
//        image.flush();
       
        return bi;
View Full Code Here

        }

        byte[] formattedImage = getFormattedImage(imageFormatter,
                scaledWidth,
                scaledHeight);
        graphics.dispose();
        return formattedImage;
    }

    /**
     * Create a java.awt.Graphics to use for an image. The Graphics will affect
View Full Code Here

    // objects, and (theoretically) the results should be identical.
    // If 'Print' is selected from the menu, the same methods wi
    // act on a Graphics object from the java.awt.PrintJob   

    doTest(javaGraphics, d);
    javaGraphics.dispose();

    // The whole pdf doc will be written when the program starts
    if ((!pdfDocumentAlreadyDone) && (pdfGraphics != null)) {
      doTest(pdfGraphics, d);
      pdfGraphics.dispose();
View Full Code Here

                                        null);
    if(pjob != null) { 
      Graphics printGraphics = pjob.getGraphics();
      if (currentPage == 1) {
        doTest(printGraphics, documentDimension);
        printGraphics.dispose();
        pjob.end();
      }
      else {
        doSecondPageTest(printGraphics);
        printGraphics.dispose();
View Full Code Here

        printGraphics.dispose();
        pjob.end();
      }
      else {
        doSecondPageTest(printGraphics);
        printGraphics.dispose();
        pjob.end();
      }
    }
    else {
      System.err.println("Can't print: printjob null");
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.