Package java.awt.image

Examples of java.awt.image.ImageProducer


        public void loadFacings() {
            base = applyColor(base);

            icon = base.getScaledInstance(56, 48, Image.SCALE_SMOOTH);
            for (int i = 0; i < 6; i++) {
                ImageProducer rotSource = new FilteredImageSource(base
                        .getSource(), new RotateFilter((Math.PI / 3) * (6 - i)));
                facings[i] = parent.createImage(rotSource);
            }

            if (wreck != null) {
                wreck = applyColor(wreck);
                for (int i = 0; i < 6; i++) {
                    ImageProducer rotSource = new FilteredImageSource(wreck
                            .getSource(), new RotateFilter((Math.PI / 3)
                            * (6 - i)));
                    wreckFacings[i] = parent.createImage(rotSource);
                }
            }
View Full Code Here


        public void loadFacings() {
            base = applyColor(base);

            icon = base.getScaledInstance(56, 48, Image.SCALE_SMOOTH);
            for (int i = 0; i < 6; i++) {
                ImageProducer rotSource = new FilteredImageSource(base
                        .getSource(), new RotateFilter((Math.PI / 3) * (6 - i)));
                facings[i] = parent.createImage(rotSource);
            }

            if (wreck != null) {
                wreck = applyColor(wreck);
                for (int i = 0; i < 6; i++) {
                    ImageProducer rotSource = new FilteredImageSource(wreck
                            .getSource(), new RotateFilter((Math.PI / 3)
                            * (6 - i)));
                    wreckFacings[i] = parent.createImage(rotSource);
                }
            }
View Full Code Here

    /**
     * Creates a disabled image
     */
    public static Image createDisabledImage(final Image i) {
        final WhiteFilter filter = new WhiteFilter();
        final ImageProducer prod = new FilteredImageSource(i.getSource(), filter);

        return Toolkit.getDefaultToolkit().createImage(prod);
    }
View Full Code Here

        if ((hints & (SCALE_SMOOTH | SCALE_AREA_AVERAGING)) != 0) {
            filter = new AreaAveragingScaleFilter(width, height);
        } else {
            filter = new ReplicateScaleFilter(width, height);
        }
        ImageProducer producer = new FilteredImageSource(getSource(), filter);
        return Toolkit.getDefaultToolkit().createImage(producer);
    }
View Full Code Here

                decoration.paintIcon(c, g, 0, decorationOffset);
            }
        }

        public void applyFilter(RGBImageFilter filter) {
            ImageProducer prod =
                new FilteredImageSource(image.getSource(), filter);
            this.image = Toolkit.getDefaultToolkit().createImage(prod);
        }
View Full Code Here

                    return rgb;
                }
            }
        };

        ImageProducer ip = new FilteredImageSource(im.getSource(), filter);
        return this.imageToBufferedImage(Toolkit.getDefaultToolkit().createImage(ip));
    }
View Full Code Here

    }

    protected void loadImage() throws FopImageException {
        int[] tmpMap = null;
        try {
            ImageProducer ip = (ImageProducer)this.m_href.getContent();
            FopImageConsumer consumer = new FopImageConsumer(ip);
            ip.startProduction(consumer);


            //Load the image into memory
            while (!consumer.isImageReady()) {
                Thread.sleep(500);
View Full Code Here

                && icon.getIconHeight() > 0) {
            BufferedImage img = new BufferedImage(icon.getIconWidth(),
                    icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
            icon.paintIcon(component, img.getGraphics(), 0, 0);
            ImageFilter filter = new RGBGrayFilter();
            ImageProducer producer = new FilteredImageSource(img.getSource(), filter);
            Image resultImage = component.createImage(producer);
            return new ImageIconUIResource(resultImage);
        }
        return super.getDisabledIcon(component, icon);
    }
View Full Code Here

  if ((hints & (SCALE_SMOOTH | SCALE_AREA_AVERAGING)) != 0) {
      filter = new AreaAveragingScaleFilter(width, height);
  } else {
      filter = new ReplicateScaleFilter(width, height);
  }
  ImageProducer prod;
  prod = new FilteredImageSource(getSource(), filter);
  return Toolkit.getDefaultToolkit().createImage(prod);
    }
View Full Code Here

                && icon.getIconHeight() > 0) {
            BufferedImage img = new BufferedImage(icon.getIconWidth(),
                    icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
            icon.paintIcon(component, img.getGraphics(), 0, 0);
            ImageFilter filter = new RGBGrayFilter();
            ImageProducer producer = new FilteredImageSource(img.getSource(), filter);
            Image resultImage = component.createImage(producer);
            return new ImageIconUIResource(resultImage);
        }
        return super.getDisabledIcon(component, icon);
    }
View Full Code Here

TOP

Related Classes of java.awt.image.ImageProducer

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.