Package java.awt

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


        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

   * @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

            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

                }
                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

                "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

        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

  private Image loadFrameIcon() {
    Toolkit toolkit= Toolkit.getDefaultToolkit();
    try {
      java.net.URL url= BaseTestRunner.class.getResource("smalllogo.gif");
      return toolkit.createImage((ImageProducer) url.getContent());
    } catch (Exception ex) {
    }
    return null;
  }
View Full Code Here

        Thread t = new Thread() {
                public void run() {
                    Filter filt = null;

                    Toolkit tk = Toolkit.getDefaultToolkit();
                    Image img = tk.createImage(url);

                    if (img != null) {
                        RenderedImage ri = loadImage(img, dr);
                        if (ri != null) {
                            filt = new RedRable(GraphicsUtil.wrap(ri));
View Full Code Here

        }
       
        buffer = bos.toByteArray();

        Toolkit tk = Toolkit.getDefaultToolkit();
        final Image img = tk.createImage(buffer);
        if (img == null) {
            return null;
        }

        RenderedImage ri = loadImage(img);
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.