Package java.awt.image

Examples of java.awt.image.FilteredImageSource


     */
    public void setImage(Image image) {
        this.image = image;
        if (image != null) {
            UIUtil.waitFor(image, this);
            grayImage = createImage(new FilteredImageSource(image.getSource(), new GrayFilter()));
            UIUtil.waitFor(grayImage, this);
        } else {
            grayImage = null;
        }
        buffer = null;
View Full Code Here


                      }
                      int toff = 0;
                      if (imagePath != null) {
                          Image img = UIUtil.loadImage(m.getClass(), imagePath);
                          if(!m.isEnabled()) {
                              img = createImage(new FilteredImageSource(img.getSource(),
                              new GrayFilter()));
                              UIUtil.waitFor(img, this);
                          }
                         
                          if (img != null) {
View Full Code Here

      }
    }
    // Draw the pattern image with foreground color
    final int foregroundColorRgb = foregroundColor.getRGB() & 0xFFFFFF;
    imageGraphics.drawImage(Toolkit.getDefaultToolkit().createImage(
        new FilteredImageSource(patternImage.getSource(),
        new RGBImageFilter() {
          {
            this.canFilterIndexColorModel = true;
          }
View Full Code Here

          public void actionPerformed(ActionEvent ev) {
            // Manage auto repeat button with mouse listener
          }
        });
      // Create a darker press icon
      setPressedIcon(new ImageIcon(createImage(new FilteredImageSource(
          ((ImageIcon)getIcon()).getImage().getSource(),
          new RGBImageFilter() {
            {
              canFilterIndexColorModel = true;
            }
View Full Code Here

          imageGraphics.dispose();
         
          final int colorRed   = this.pieceColor & 0xFF0000;
          final int colorGreen = this.pieceColor & 0xFF00;
          final int colorBlue  = this.pieceColor & 0xFF;
          setIcon(new ImageIcon(c.createImage(new FilteredImageSource(image.getSource (),
              new RGBImageFilter() {
                {
                  canFilterIndexColorModel = true;
                }
 
View Full Code Here

    /**
     * Creates an image from an existing one by replacing the old color with the new color.
     */
    public static Image createImage(Image i, Color oldColor, Color newColor) {
        MaskFilter filter = MaskFilter.getInstance(oldColor, newColor);
        ImageProducer prod = new FilteredImageSource(i.getSource(), filter);
        Image image = Toolkit.getDefaultToolkit().createImage(prod);
        return image;
    }
View Full Code Here

     * @param insets the insets. The border area with the insets will not be tinted.
     * @return a tinted image
     */
    public static Image createTintedImage(Image i, Color color, Insets insets) {
        TintFilter filter = new TintFilter(color, i.getWidth(null), i.getHeight(null), insets);
        ImageProducer prod = new FilteredImageSource(i.getSource(), filter);
        return Toolkit.getDefaultToolkit().createImage(prod);
    }
View Full Code Here

            }

            ImageFilter scaleFilter =
                new ReplicateScaleFilter((int) (zoom * width), (int)(vzoom*height));
            scaledSpectrogram =
                createImage(new FilteredImageSource(spectrogram.getSource(),
                                                    scaleFilter));
            Dimension sz = getSize();
            repaint(0, 0, 0, sz.width - 1, sz.height - 1);
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

            height = (int)(vzoom*height);

            ImageFilter scaleFilter =
                new ReplicateScaleFilter(width, height);
            scaledSpectrogram =
                createImage(new FilteredImageSource(spectrogram.getSource(),
                                                    scaleFilter));

            // so ScrollPane gets notified of the new size:
            setPreferredSize(new Dimension(width, height));
            revalidate();
View Full Code Here

     */
    public Image getBanner(int x, int y, int sx, int sy)
    {
        Image cropBanner = null;
        CropImageFilter cif = new CropImageFilter(x, y, sx, sy);
        cropBanner = createImage(new FilteredImageSource(theBanner.getSource(), cif));
        return cropBanner;
    }
View Full Code Here

TOP

Related Classes of java.awt.image.FilteredImageSource

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.