Package java.awt.image

Examples of java.awt.image.PixelGrabber.grabPixels()


        final PixelGrabber pg = new PixelGrabber(this.image, 0, startRow,
            this.width, nRows, pixels, 0, this.width);
        try
        {
          pg.grabPixels();
        }
        catch (Exception e)
        {
          logger.error("interrupted waiting for pixels!", e);
          return false;
View Full Code Here


  public static MemoryImageSource rotate(Image image, CardDimensions dimensions) {
    int buffer[] = new int[dimensions.frameWidth * dimensions.frameHeight];
    int rotate[] = new int[dimensions.frameHeight * dimensions.frameWidth];
    PixelGrabber grabber = new PixelGrabber(image, 0, 0, dimensions.frameWidth, dimensions.frameHeight, buffer, 0, dimensions.frameWidth);
    try {
      grabber.grabPixels();
    }
    catch(InterruptedException e) {
      e.printStackTrace();
    }
    for(int y = 0; y < dimensions.frameHeight; y++) {
View Full Code Here

     int x = 0;
     int y = 0;
         m_aPixels = new int[m_w * m_h];
         PixelGrabber pg = new PixelGrabber(m_aImage, x, y, m_w, m_h, m_aPixels, 0, m_w);
         try {
             pg.grabPixels();
         } catch (InterruptedException e) {
             System.err.println("interrupted waiting for pixels!");
             return;
         }
         if ((pg.getStatus() & ImageObserver.ABORT) != 0) {
View Full Code Here

        // use a pixel grabber to retrieve the image's color model;
        // grabbing a single pixel is usually sufficient
        PixelGrabber pg = new PixelGrabber(img, 0, 0, 1, 1, false);
        try {
            pg.grabPixels();
        } catch (InterruptedException e) {
            // ignore
        }

        // recast the AWT image into a BufferedImage (using alpha RGB)
View Full Code Here

          // Pixel die im Kollisionsbereich liegen in die Arrays laden
          PixelGrabber grabber = new PixelGrabber(currentImage,
              Math.abs(hitbox.x - thisArea.getBounds().x), Math.abs(hitbox.y - thisArea.getBounds().y),
              width, height, thisPixels, 0, width);
          grabber.grabPixels();
          grabber = new PixelGrabber(((Sprite)other).getCurrentImage(),
              Math.abs(other.getHitbox().x - thisArea.getBounds().x), Math.abs(other.getHitbox().y - thisArea.getBounds().y),
              width, height, otherPixels, 0, width);
          grabber.grabPixels();
         
View Full Code Here

              width, height, thisPixels, 0, width);
          grabber.grabPixels();
          grabber = new PixelGrabber(((Sprite)other).getCurrentImage(),
              Math.abs(other.getHitbox().x - thisArea.getBounds().x), Math.abs(other.getHitbox().y - thisArea.getBounds().y),
              width, height, otherPixels, 0, width);
          grabber.grabPixels();
         
          ColorModel cm = grabber.getColorModel();
         
          // Prüfen ob in den Pixeln der jeweilig gleichen Position etwas ist
          for (int i = 0; i < thisPixels.length; i++)
View Full Code Here

    int destHeight = dy2 - dy1;
    int[] pixels = new int[width * height];
    PixelGrabber pg = new PixelGrabber(img, sx1, sy1, sx2 - sx1, sy2 - sy1,
        pixels, 0, width);
    try {
      pg.grabPixels();
    } catch (InterruptedException e) {
      return false;
    }
    AffineTransform matrix = new AffineTransform(_transform);
    matrix.translate(dx1, dy1);
View Full Code Here

        public ImageInfo(Image img) throws InterruptedException {
            w = img.getWidth(null);
            h = img.getHeight(null);
            pixels = new int[w*h];
            PixelGrabber pg = new PixelGrabber(img, 0, 0, w, h, pixels, 0, w);
            pg.grabPixels();
        }
       
        public boolean equals(Object that) {
            if(that == null) {
                return false;
View Full Code Here

        public ImageInfo(Image img) throws InterruptedException {
            w = img.getWidth(null);
            h = img.getHeight(null);
            pixels = new int[w*h];
            PixelGrabber pg = new PixelGrabber(img, 0, 0, w, h, pixels, 0, w);
            pg.grabPixels();
        }
       
        public boolean equals(Object that) {
            if(that == null) {
                return false;
View Full Code Here

        public ImageInfo(Image img) throws InterruptedException {
            w = img.getWidth(null);
            h = img.getHeight(null);
            pixels = new int[w*h];
            PixelGrabber pg = new PixelGrabber(img, 0, 0, w, h, pixels, 0, w);
            pg.grabPixels();
        }
       
        public boolean equals(Object that) {
            if(that == null) {
                return false;
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.