Examples of createImage()


Examples of java.awt.Component.createImage()

      Component root = adaptable.getParentContainer();
      int w = root.getWidth();
      int h = root.getHeight();
      if (offscreen == null || last_width != w || last_height != h) {
        DUMMY_DIALOG.add(root);
        offscreen = root.createImage(w, h);
        Graphics offg = offscreen.getGraphics();
        root.print(offg);
        last_width = w;
        last_height = h;
        DUMMY_DIALOG.remove(root);
View Full Code Here

Examples of java.awt.Container.createImage()

        private void startDrag() {
            Container parent = getParent();

            if (paintBackgroundUnderDragRect) { // 2007/02/27
                if (desktopImage == null || (desktopImage.getWidth() != parent.getWidth()) || (desktopImage.getHeight() != parent.getHeight())) {
                    desktopImage = (BufferedImage) parent.createImage(parent.getWidth(),
                            parent.getHeight());
                    subImage = null;
                }
                Graphics g = desktopImage.getGraphics();
                parent.paint(g);
View Full Code Here

Examples of java.awt.Frame.createImage()

   * @return FontMetrics for a font
   */
  public FontMetrics getFontMetrics(Font font) {
    Frame dummy = new Frame();
    dummy.addNotify();
    Image image = dummy.createImage(100, 100);
    if (image == null) {
      System.err.println("getFontMetrics: image is null");
    }
    Graphics graphics = image.getGraphics();
    return graphics.getFontMetrics(font);
View Full Code Here

Examples of java.awt.Toolkit.createImage()

        for (int x = 0; x < 6; x++) {
            for (int y = 0; y < 6; y++) {
                int[] pixels = decompressSubframe(x, y, colortable);

                java.awt.Image bitmap = tk.createImage(new MemoryImageSource(width, height, pixels, 0, width));

                g.drawImage(bitmap, x * 256, y * 256, null);
            }
        }

View Full Code Here

Examples of java.awt.Toolkit.createImage()

        if (getNeedToRegenerate() || bitmap == null) {

            computePixels();

            Toolkit tk = Toolkit.getDefaultToolkit();
            bitmap = tk.createImage(new MemoryImageSource(width, height, pixels, 0, width));
        }

        if (imageFilter != null) {
            bitmap = filterImage();
        }
View Full Code Here

Examples of java.awt.Toolkit.createImage()

   * @param d a <code>Dimension</code> value
   */
  private void drawSampleImage(Graphics g, Dimension d) {
    try {
      Toolkit toolkit = Toolkit.getDefaultToolkit();
      Image img = toolkit.createImage(sampleImageFile);
      MediaTracker tracker = new MediaTracker(drawingArea);
      tracker.addImage(img, 0);
      try {
        tracker.waitForID(0);
      }
View Full Code Here

Examples of java.awt.Toolkit.createImage()

            url = classObject.getResource ( strFileName );
            if ( url != null ) {
                objImageProducer = url.getContent ();
                if ( objImageProducer instanceof ImageProducer ) {
                    imageProducer = (ImageProducer) objImageProducer;
                    image = toolkit.createImage ( imageProducer );
                }
                else if ( objImageProducer instanceof BufferedInputStream ) {
                    streamImage = (BufferedInputStream) objImageProducer;
                    arrImageBytes = new byte [streamImage.available()];
                    streamImage.read ( arrImageBytes );
View Full Code Here

Examples of java.awt.Toolkit.createImage()

                }
                else if ( objImageProducer instanceof BufferedInputStream ) {
                    streamImage = (BufferedInputStream) objImageProducer;
                    arrImageBytes = new byte [streamImage.available()];
                    streamImage.read ( arrImageBytes );
                    image = toolkit.createImage ( arrImageBytes );
                }
            }
        }
        catch ( Exception exception ) {
            exception.printStackTrace ();
View Full Code Here

Examples of java.awt.Toolkit.createImage()

                "images/" + icon);
        if (imageUrl == null) {
            return null;
        }

        return toolkit.createImage(imageUrl);
    }

    /**
     * Gets an Icon from the resources (usually the jar or current directory
     * that the app is running from)
View Full Code Here

Examples of java.awt.Toolkit.createImage()

        int[] pixels = (int[]) (s.readObject());

        if (pixels != null) {
            Toolkit tk = Toolkit.getDefaultToolkit();
            ColorModel cm = ColorModel.getRGBdefault();
            image = tk.createImage(new MemoryImageSource(w, h, cm, pixels, 0, w));
            loadImage(image);
        }
    }

    private void writeObject (ObjectOutputStream s) throws IOException {
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.