Package java.awt.image

Examples of java.awt.image.ImageProducer


    protected boolean loadBitmap() {
        int[] tmpMap = null;
        try {
            URLConnection con = new DummyConnection(inputStream);

            ImageProducer ip = (ImageProducer) con.getContent();
            if (ip == null) {
                return false;
            }
            FopImageConsumer consumer = new FopImageConsumer(ip);
            ip.startProduction(consumer);

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


     * {@inheritDoc}
     */
    public void loadImage() throws GraphicException {
        int[] tmpMap = null;
        try {
            final ImageProducer ip = (ImageProducer) getUrl().getContent();
            final ImageConsumerImpl consumer = new ImageConsumerImpl(ip);
            ip.startProduction(consumer);


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

      return null;
    }

    Toolkit toolkit = Toolkit.getDefaultToolkit();

    ImageProducer producer = icon.getSource();

    // If direction is RTL, flip the source image
    if (_isRightToLeft(context))
      producer = new FilteredImageSource(producer, new MirrorImageFilter());
View Full Code Here

    Image       baseImage,
    ImageFilter imageFilter
    )
  {
    // get the filtered image producer
    ImageProducer producer = new FilteredImageSource(baseImage.getSource(),
                                                     imageFilter);

    // return the filtered image
    return Toolkit.getDefaultToolkit().createImage(producer);
  }
View Full Code Here

        Object urlContent = imageURL.getContent();

        // Sun VM's return ImageProducers
        if (urlContent instanceof ImageProducer)
        {
          ImageProducer producer = (ImageProducer) urlContent;

          outImage = Toolkit.getDefaultToolkit().createImage(producer);
        }
        // Microsoft VM's return Images
        else if (urlContent instanceof Image)
View Full Code Here

    // Get the colorizing filter
    int[] targetColors = _getTargetColors(requestedProperties);
    ImageFilter filter = new ColorizingFilter(_SOURCE_COLORS, targetColors);

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    ImageProducer producer = icon.getSource();

    // If direction is RTL, flip the source image
    if (_isRightToLeft(context))
      producer = new FilteredImageSource(producer, new MirrorImageFilter());
View Full Code Here

      case SCALE_REPLICATE:
      default:
  filter = new ReplicateScaleFilter(width, height);
    }

    ImageProducer producer = new FilteredImageSource(getSource(), filter);
    return Toolkit.getDefaultToolkit().createImage(producer);
  }
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

                && 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

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.