Package java.awt.image

Examples of java.awt.image.MemoryImageSource


        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

    for (int x = w; x-- > 0; ) {
      for (int y = h; y-- > 0; ) {
        pix[y * w + x] = palette[pixels[x][y]];
      }
    }
    return new MemoryImageSource(w, h, pix, 0, w);
  }
View Full Code Here

    /**
     * Set the image from a 1D RGB pixel array.
     */
    public void setImage(int w, int h, int pix[]) {
        setImage(createImage(new MemoryImageSource(w, h, pix, 0, w)));
    }
View Full Code Here

  private synchronized void createNewBuffer(int w, int h) {
    // should I be copy over pixels instead?
    offscreenPixels = new int[w * h];
    offscreenScanSize = w;
    offscreenSource = new MemoryImageSource(w, h, offscreenPixels, 0, w);
    offscreenSource.setAnimated(true);
    offscreenBuffer = createImage(offscreenSource);
  }
View Full Code Here

    }
    }

  private synchronized void createNewBuffer(int w, int h) {
    offscreenPixels = new int[w * h];
    MemoryImageSource source = new MemoryImageSource(w, h, offscreenPixels, 0, w);
    source.setAnimated(true);
    Image n = createImage(source);
    if (offscreenBuffer != null) {
      // should I be copying over pixels instead?
      n.getGraphics().drawImage(offscreenBuffer, 0,0,null);
    }
View Full Code Here

                throw new IllegalArgumentException();
            }
        }

        fMain = new Frame("HSQL Transfer Tool");
        imgEmpty = createImage(new MemoryImageSource(2, 2, new int[4 * 4], 2,
                2));

        fMain.setIconImage(imgEmpty);
        fMain.addWindowListener(this);
        fMain.setSize(640, 480);
View Full Code Here

    }

    public void main() {

        fMain = new Frame("HSQL Database Manager");
        imgEmpty = createImage(new MemoryImageSource(2, 2, new int[4 * 4], 2,
                2));

        fMain.setIconImage(imgEmpty);
        fMain.addWindowListener(this);

View Full Code Here

          imageWithWhiteBackgoundPixels [i] = 0;
        }          
      }
     
      sceneRoot.removeChild(model);
      return new ImageIcon(Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(
          imageWithWhiteBackgound.getWidth(), imageWithWhiteBackgound.getHeight(),
          imageWithWhiteBackgoundPixels, 0, imageWithWhiteBackgound.getWidth())));
    }
View Full Code Here

    }
   
    BufferedImage iconImage = new BufferedImage(imageWithWhiteBackgound.getWidth(), imageWithWhiteBackgound.getHeight(),
        BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2D = (Graphics2D)iconImage.getGraphics();
    g2D.drawImage(Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(
        imageWithWhiteBackgound.getWidth(), imageWithWhiteBackgound.getHeight(),
        imageWithWhiteBackgoundPixels, 0, imageWithWhiteBackgound.getWidth())), null, null);
    g2D.dispose();

    return iconImage;
View Full Code Here

TOP

Related Classes of java.awt.image.MemoryImageSource

Copyright © 2018 www.massapicom. 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.