Package java.awt.image

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


        textArea.printAll(image.getGraphics());

        // Grab appropriate pixels to get the color
        PixelGrabber pixelGrabber = new PixelGrabber(image, 5, 5, 1, 1, pixels, 0, 1);
        try {
            pixelGrabber.grabPixels();
            if (pixels[0] == -1) {
                return Color.WHITE; // System background not customized
            }
        } catch (InterruptedException e) {
            return getNonGTKProfilerResultsBackground();
View Full Code Here


    public DirectGif89Frame(final Image img) throws IOException {
        PixelGrabber pg = new PixelGrabber(img, 0, 0, -1, -1, true);

        String errmsg = null;
        try {
            if (!pg.grabPixels()) {
                errmsg = "can't grab pixels from image";
            }
        } catch (InterruptedException e) {
            errmsg = "interrupted grabbing pixels from image";
        }
View Full Code Here

    public DirectGif89Frame(final Image img) throws IOException {
        PixelGrabber pg = new PixelGrabber(img, 0, 0, -1, -1, true);

        String errmsg = null;
        try {
            if (!pg.grabPixels()) {
                errmsg = "can't grab pixels from image";
            }
        } catch (InterruptedException e) {
            errmsg = "interrupted grabbing pixels from image";
        }
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

    final PixelGrabber grabber = new PixelGrabber(this.entryImage, 0, 0, w,
        h, true);
    try {

      grabber.grabPixels();
      this.pixelMap = (int[]) grabber.getPixels();
      findBounds(w, h);

      // now downsample
View Full Code Here

    final PixelGrabber grabber = new PixelGrabber(image, 0, 0,
        getImageWidth(), getImageHeight(), true);

    try {
      grabber.grabPixels();
    } catch (final InterruptedException e) {
      throw new EncogError(e);
    }

    setPixelMap((int[]) grabber.getPixels());
View Full Code Here

    final PixelGrabber grabber = new PixelGrabber(image, 0, 0,
        this.imageWidth, this.imageWidth, true);

    try {
      grabber.grabPixels();
    } catch (final InterruptedException e) {
      throw new EncogError(e);
    }

    this.pixelMap = (int[]) grabber.getPixels();
View Full Code Here

    final PixelGrabber grabber = new PixelGrabber(this.entryImage, 0, 0, w,
        h, true);
    try {

      grabber.grabPixels();
      this.pixelMap = (int[]) grabber.getPixels();
      findBounds(w, h);

      // now downsample
      final SampleData data = this.sample.getData();
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(image, 0, 0, 1, 1, false);

        try {
            pg.grabPixels();
        } catch (InterruptedException e) {
        }

        // Get the image's color model
        ColorModel cm = pg.getColorModel();
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.