Examples of drawImage()


Examples of java.awt.Graphics.drawImage()

      // draw loading bar, clipping it depending on percentage done
      if (progressbar != null) {
        int barSize = (progressbar.getWidth(null) * percentage) / 100;
        og.clipRect(x-progressbar.getWidth(null)/2, 0, barSize, offscreen.getHeight(null));
        og.drawImage(progressbarBuffer, x-progressbar.getWidth(null)/2, y-progressbar.getHeight(null)/2, this);
      }

      painting = false;
    }

View Full Code Here

Examples of java.awt.Graphics.drawImage()

      g.setColor(bgColor);
      g.fillRect(0, 0, buffer.getWidth(null), buffer.getHeight(null));

      // buffer background is cleared, so draw logo under progressbar
      if (img == progressbar && logo != null) {
        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();
View Full Code Here

Examples of java.awt.Graphics.drawImage()

      if (img == progressbar && logo != null) {
        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();
    }
View Full Code Here

Examples of java.awt.Graphics.drawImage()

        // copy the source image into the produced image
        Graphics g = texImage.getGraphics();
        g.setColor(new Color(0f,0f,0f,0f));
        g.fillRect(0,0,texWidth,texHeight);
        g.drawImage(bufferedImage,0,0,null);

        // build a byte buffer from the temporary image
        // that be used by OpenGL to produce a texture.
        byte[] data = ((DataBufferByte) texImage.getRaster().getDataBuffer()).getData();
View Full Code Here

Examples of java.awt.Graphics.drawImage()

        // we are now using good oldfashioned ImageIcon to load
        // 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

Examples of java.awt.Graphics.drawImage()

       
        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();
       
View Full Code Here

Examples of java.awt.Graphics.drawImage()

                    BufferedImage tmpImage = new BufferedImage(endSize,
                            endSize, BufferedImage.TYPE_INT_RGB);
                    Graphics g = tmpImage.getGraphics();
                    ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                            RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                    g.drawImage(currentImage, 0, 0, tmpImage.getWidth(),
                            tmpImage.getHeight(), null);
                    currentImage = tmpImage;
                }
                return currentImage;
            } else {
View Full Code Here

Examples of java.awt.Graphics.drawImage()

                BufferedImage tmpImage = new BufferedImage(currentSize >> 1,
                        currentSize >> 1, BufferedImage.TYPE_INT_RGB);
                Graphics g = tmpImage.getGraphics();
                ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                        RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                g.drawImage(currentImage, 0, 0, tmpImage.getWidth(),
                        tmpImage.getHeight(), null);
                currentImage = tmpImage;
                currentSize = currentImage.getWidth(null);
                delta = currentSize - endSize;
                nextPow2 = currentSize >> 1;
View Full Code Here

Examples of java.awt.Graphics.drawImage()

            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);
            }
        }

        JLabel picture = new JLabel(new ImageIcon(bigImage));
        JFrame frame = com.bbn.openmap.util.PaletteHelper.getPaletteWindow(picture,
View Full Code Here

Examples of java.awt.Graphics2D.drawImage()

           // make sure alpha values do not add up for each row:
           g2d.setComposite(AlphaComposite.Src);
           // calculate scanline by scanline in order to safe memory.
           // It also seems to run faster like that
           for (y = 0; y < height; y++) {
               g2d.drawImage(image, null, 0, -y);
               // now pixels contains the rgb values of the row y!
               if (numNodes > MAX_NODES) {
                   // Prune one level if the color tree is too large.
                   root.pruneLevel();
                   depth--;
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.