Package java.awt.image

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


        PixelGrabber grabber = new PixelGrabber(image, 0, 0, w, h, pix, 0, w);
       
        try {
            if (grabber.grabPixels() != true) {
                throw new IOException("Grabber returned false: " +
                                      grabber.status());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
View Full Code Here


    PixelGrabber grabber = new PixelGrabber(image, 0, 0, w, h, pix, 0, w);
   
    try {
      if (grabber.grabPixels() != true) {
        throw new IOException("Grabber returned false: " +
        grabber.status());
      }
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
View Full Code Here

        final int lines = image.getHeight(null);
        final int pixels[] = new int[width * lines];
        final PixelGrabber grabber = new PixelGrabber(image, 0, 0, width, lines, pixels, 0, width);
        grabber.setColorModel(ColorModel.getRGBdefault());
        try {
            if (grabber.grabPixels() && (grabber.status() & ImageObserver.ALLBITS) != 0) {
                final int[][] array = new int[lines][width];
                int srcPos = 0;
                for (int line = 0; line < lines; line++) {
                    array[line] = new int[width];
                    System.arraycopy(pixels, srcPos, array[line], 0, width);
View Full Code Here

        final int lines = image.getHeight(null);
        final int pixels[] = new int[width * lines];
        final PixelGrabber grabber = new PixelGrabber(image, 0, 0, width, lines, pixels, 0, width);
        grabber.setColorModel(ColorModel.getRGBdefault());
        try {
            if (grabber.grabPixels() && (grabber.status() & ImageObserver.ALLBITS) != 0) {
                final int[][] array = new int[lines][width];
                int srcPos = 0;
                for (int line = 0; line < lines; line++) {
                    array[line] = new int[width];
                    System.arraycopy(pixels, srcPos, array[line], 0, width);
View Full Code Here

    }

    try {
      if (grabber.grabPixels() != true)
        throw new AWTException(Strings.get("grabberError") + ": "
          + grabber.status());
    } catch (InterruptedException e) {
      ;
    }
   
    byte r[][] = new byte[width_][height_];
View Full Code Here

        final int lines = image.getHeight(null);
        final int pixels[] = new int[width * lines];
        final PixelGrabber grabber = new PixelGrabber(image, 0, 0, width, lines, pixels, 0, width);
        grabber.setColorModel(ColorModel.getRGBdefault());
        try {
            if (grabber.grabPixels() && (grabber.status() & ImageObserver.ALLBITS) != 0) {
                final int[][] array = new int[lines][width];
                int srcPos = 0;
                for (int line = 0; line < lines; line++) {
                    array[line] = new int[width];
                    System.arraycopy(pixels, srcPos, array[line], 0, width);
View Full Code Here

        final int lines = image.getHeight(null);
        final int pixels[] = new int[width * lines];
        final PixelGrabber grabber = new PixelGrabber(image, 0, 0, width, lines, pixels, 0, width);
        grabber.setColorModel(ColorModel.getRGBdefault());
        try {
            if (grabber.grabPixels() && (grabber.status() & ImageObserver.ALLBITS) != 0) {
                final int[][] array = new int[lines][width];
                int srcPos = 0;
                for (int line = 0; line < lines; line++) {
                    array[line] = new int[width];
                    System.arraycopy(pixels, srcPos, array[line], 0, width);
View Full Code Here

    }
    if ((pg1.status() & ImageObserver.ABORT) != 0) {
      System.err.println("image fetch aborted or errored");
      return null;
    }
    if ((pg2.status() & ImageObserver.ABORT) != 0) {
      System.err.println("image fetch aborted or errored");
      return null;
    }

    for (int j = 0; j < h; j++) {
View Full Code Here

    try {
      pg.grabPixels();
    } catch (InterruptedException e) {
      throw new RuntimeException("Image fetch interrupted");
    }
    if ((pg.status() & ImageObserver.ABORT) != 0)
      throw new RuntimeException("Image fetch aborted");
    if ((pg.status() & ImageObserver.ERROR) != 0)
      throw new RuntimeException("Image fetch error");
    BufferedImage p = new BufferedImage(pg.getWidth(), pg.getHeight(), BufferedImage.TYPE_INT_ARGB);
    p.setRGB(0, 0, pg.getWidth(), pg.getHeight(), (int[])pg.getPixels(), 0, pg.getWidth());
View Full Code Here

    } catch (InterruptedException e) {
      throw new RuntimeException("Image fetch interrupted");
    }
    if ((pg.status() & ImageObserver.ABORT) != 0)
      throw new RuntimeException("Image fetch aborted");
    if ((pg.status() & ImageObserver.ERROR) != 0)
      throw new RuntimeException("Image fetch error");
    BufferedImage p = new BufferedImage(pg.getWidth(), pg.getHeight(), BufferedImage.TYPE_INT_ARGB);
    p.setRGB(0, 0, pg.getWidth(), pg.getHeight(), (int[])pg.getPixels(), 0, pg.getWidth());
    return p;
  }
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.