Examples of ImageFilter


Examples of java.awt.image.ImageFilter

     * @see        java.awt.Image#SCALE_REPLICATE
     * @see        java.awt.Image#SCALE_AREA_AVERAGING
     * @since      JDK1.1
     */
    public Image getScaledInstance(int width, int height, int hints) {
        ImageFilter filter;
        if ((hints & (SCALE_SMOOTH | SCALE_AREA_AVERAGING)) != 0) {
            filter = new AreaAveragingScaleFilter(width, height);
        } else {
            filter = new ReplicateScaleFilter(width, height);
        }
View Full Code Here

Examples of java.awt.image.ImageFilter

     * @see        java.awt.Image#SCALE_REPLICATE
     * @see        java.awt.Image#SCALE_AREA_AVERAGING
     * @since      JDK1.1
     */
    public Image getScaledInstance(int width, int height, int hints) {
  ImageFilter filter;
  if ((hints & (SCALE_SMOOTH | SCALE_AREA_AVERAGING)) != 0) {
      filter = new AreaAveragingScaleFilter(width, height);
  } else {
      filter = new ReplicateScaleFilter(width, height);
  }
View Full Code Here

Examples of java.awt.image.ImageFilter

                && icon.getIconWidth() > 0
                && 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

Examples of java.awt.image.ImageFilter

    /**
     * Get a rectangular region of the baseImage modified by an image filter.
     */
    Image getHighlight(int x, int y, int w, int h, ImageFilter filter) {
  ImageFilter cropfilter = new CropImageFilter(x, y, w, h);
  ImageProducer prod = new FilteredImageSource(baseImage.getSource(),
                 cropfilter);
  return makeImage(prod, filter, 0);
    }
View Full Code Here

Examples of java.awt.image.ImageFilter

    public synchronized void addConsumer(ImageConsumer ic) {
        if (proxies == null) {
            proxies = new Hashtable();
        }
        if (!proxies.containsKey(ic)) {
            ImageFilter imgf = filter.getFilterInstance(ic);
            proxies.put(ic, imgf);
            src.addConsumer(imgf);
        }
    }
View Full Code Here

Examples of java.awt.image.ImageFilter

     *
     * @see ImageConsumer
     */
    public synchronized void removeConsumer(ImageConsumer ic) {
        if (proxies != null) {
            ImageFilter imgf = (ImageFilter) proxies.get(ic);
            if (imgf != null) {
                src.removeConsumer(imgf);
                proxies.remove(ic);
                if (proxies.isEmpty()) {
                    proxies = null;
View Full Code Here

Examples of java.awt.image.ImageFilter

     */
    public void startProduction(ImageConsumer ic) {
        if (proxies == null) {
            proxies = new Hashtable();
        }
        ImageFilter imgf = (ImageFilter) proxies.get(ic);
        if (imgf == null) {
            imgf = filter.getFilterInstance(ic);
            proxies.put(ic, imgf);
        }
        src.startProduction(imgf);
View Full Code Here

Examples of java.awt.image.ImageFilter

     *
     * @see ImageConsumer
     */
    public void requestTopDownLeftRightResend(ImageConsumer ic) {
        if (proxies != null) {
            ImageFilter imgf = (ImageFilter) proxies.get(ic);
            if (imgf != null) {
                imgf.resendTopDownLeftRight(src);
            }
        }
    }
View Full Code Here

Examples of java.awt.image.ImageFilter

    y += 3;
    x += 3;

    if(mIsGrayFilter && !mIsExpired && mProgram.isExpired()) {
      ImageFilter filter = new GrayFilter(true, 60);
      mScaledIcon.setImage(c.createImage(new FilteredImageSource(mScaledIcon.getImage().getSource(),filter)));
      mIsExpired = true;
    }

    if(c.getForeground().getAlpha() != 255) {
      ImageFilter filter = new RGBImageFilter() {
        public int filterRGB(int x, int y, int rgb) {
          if ((rgb & 0xff000000) != 0) {
            return (rgb & 0xffffff) | (c.getForeground().getAlpha() << 24);
          }
          return rgb;
View Full Code Here

Examples of java.awt.image.ImageFilter

    public synchronized void addConsumer(ImageConsumer ic) {
        if (proxies == null) {
            proxies = new Hashtable();
        }
        if (!proxies.containsKey(ic)) {
            ImageFilter imgf = filter.getFilterInstance(ic);
            proxies.put(ic, imgf);
            src.addConsumer(imgf);
        }
    }
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.