Package java.awt.image

Examples of java.awt.image.FilteredImageSource


               
                int id = tileset.addImage(img);
               
                for(int x = 0; x < framesx; x++) {
                  for(int y = 0; y < framesy; y++) {
                    frames[framesx*y+x] = createImage(new FilteredImageSource(img.getSource(), new CropImageFilter(x*map.getTileWidth(), y*map.getTileHeight(), map.getTileWidth(), map.getTileHeight())));
                  }
                }
               
                //TODO add delay input through dialog
                newTile.setSprite(new Sprite(frames, 10)); //chopped up animation
View Full Code Here


        Toolkit tk = Toolkit.getDefaultToolkit();

        if (transparentColor != null) {
            int rgb = transparentColor.getRGB();
            image = tk.createImage(
                    new FilteredImageSource(image.getSource(),
                            new TransparentImageFilter(rgb)));
        }

        BufferedImage buffered = new BufferedImage(
                image.getWidth(null),
View Full Code Here

        Toolkit tk = Toolkit.getDefaultToolkit();

        if (transparentColor != null) {
            int rgb = transparentColor.getRGB();
            image = tk.createImage(
                    new FilteredImageSource(image.getSource(),
                            new TransparentImageFilter(rgb)));
        }

        BufferedImage buffered = new BufferedImage(
                image.getWidth(null),
View Full Code Here

        // Pass old image through grayscale filter, creating new image
        // This is necessary since GIFs are limited to 255 colors.
        // The easiest way to guarantee this is to convert to greyscale.
        Image oldImage = createOutputImage();
        ImageFilter filter = new GreyscaleFilter();
        Image newImage = createImage(new FilteredImageSource(oldImage.getSource(), filter));

        // Use MediaTracker to wait for new image to be created
        try {
            MediaTracker tracker = new MediaTracker(this);
            tracker.addImage(newImage, 0);
View Full Code Here

                logger.error("Unable to read image data!");
                return Sequence.EMPTY_SEQUENCE;
            }
     
            //crop the image
            Image cropImage = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(image.getSource(), new CropImageFilter(x1, y1, x2, y2)));
            if(cropImage instanceof BufferedImage) {
                // just in case cropImage is allready an BufferedImage
                bImage = (BufferedImage)cropImage;
            } else {
                bImage = new BufferedImage(cropImage.getHeight(null),
View Full Code Here

              ImageFilter cropFilter = new CropImageFilter(
                  (j - colMin) * width,
                  (i - rowMin) * height, width, height);
              Image destImage = Toolkit.getDefaultToolkit()
                  .createImage(
                      new FilteredImageSource(image
                          .getSource(), cropFilter));

              BufferedImage tileImage = new BufferedImage(width,
                  height, BufferedImage.TYPE_INT_ARGB);
              Graphics2D g = tileImage.createGraphics();
View Full Code Here

  public static Image createColouredRobotImage(Image img, Color color) {
    return (color == null)
        ? img
        : (img == null)
            ? null
            : Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(img.getSource(), new ColorFilter(color)));
  }
View Full Code Here

//                return (rgb & 0xffff0000);
            }
        };

        crotchetDown.redImage = createImage(new FilteredImageSource(
                crotchetDown.image.getSource(),
                filter));
        crotchetUp.redImage = createImage(new FilteredImageSource(
                crotchetUp.image.getSource(),
                filter));
        quaverDown.redImage = createImage(new FilteredImageSource(
                quaverDown.image.getSource(),
                filter));
        quaverUp.redImage = createImage(new FilteredImageSource(
                quaverUp.image.getSource(),
                filter));
        semiquaverDown.redImage = createImage(new FilteredImageSource(
                semiquaverDown.image.getSource(),
                filter));
        semiquaverUp.redImage = createImage(new FilteredImageSource(
                semiquaverUp.image.getSource(),
                filter));
        minimDown.redImage = createImage(new FilteredImageSource(
                minimDown.image.getSource(),
                filter));
        minimUp.redImage = createImage(new FilteredImageSource(
                minimUp.image.getSource(),
                filter));
        semibreve.redImage = createImage(new FilteredImageSource(
                semibreve.image.getSource(),
                filter));
        dot.redImage = createImage(new FilteredImageSource(
                dot.image.getSource(),
                filter));
        semiquaverRest.redImage = createImage(new FilteredImageSource(
                semiquaverRest.image.getSource(),
                filter));
        quaverRest.redImage = createImage(new FilteredImageSource(
                quaverRest.image.getSource(),
                filter));
        crotchetRest.redImage = createImage(new FilteredImageSource(
                crotchetRest.image.getSource(),
                filter));
        minimRest.redImage = createImage(new FilteredImageSource(
                minimRest.image.getSource(),
                filter));
        sharp.redImage = createImage(new FilteredImageSource(
                sharp.image.getSource(),
                filter));
        flat.redImage = createImage(new FilteredImageSource(
                flat.image.getSource(),
                filter));
        natural.redImage = createImage(new FilteredImageSource(
                natural.image.getSource(),
                filter));
        delete.redImage = createImage(new FilteredImageSource(
                delete.image.getSource(),
                filter));

        /*
         * There appears to be a problem with my use of MediaTracker under
View Full Code Here

        RedFilter() {
        }

        RedFilter(Image image) {
            this.image = image;
            redImage = createImage(new FilteredImageSource(image.getSource(),
                    filter));
        }
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.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.