Package java.awt.image

Examples of java.awt.image.ImageFilter


        g.fillOval((int) ((gameControl.getTime().getTimeTraveled()/((double)(Place.OREGON.getLocation()))*width-30)) + 20, (height/2)-4, 10, 10);
        g.drawImage(spaceship, (int) ((gameControl.getTime().getTimeTraveled()/((double)(Place.OREGON.getLocation()))*width)-30) + 12, (height/2)-50, 30, 30,null);
      }
  
   private Image makeColorTransparent (BufferedImage im, final Color color) {
          ImageFilter filter = new RGBImageFilter() {
          // the color we are looking for... Alpha bits are set to opaque
          public int markerRGB = color.getRGB() | 0xFF000000;

          public final int filterRGB(int x, int y, int rgb) {
              if ( ( rgb | 0xFF000000 ) == markerRGB ) {
View Full Code Here


    /**
     * The actual scaling code.
     */
    private Image scale(Image img, int width, int height) {
        ImageFilter filter;
        filter = new ImprovedAveragingScaleFilter(img.getWidth(null), img
                .getHeight(null), width, height);

        ImageProducer prod;
        prod = new FilteredImageSource(img.getSource(), filter);
View Full Code Here

            filterImages(tracker, applet, null, numimages);
    }

    private void filterImages(MediaTracker tracker, Applet applet, Toolkit tk, int numimages) {
        imgf = new Image[numimages];
        ImageFilter filter = new HotTrackImageFilter();

        for (int i = 0; i < numimages; i++) {
            if (applet != null)
                imgf[i] = applet.createImage(new FilteredImageSource(img[i].getSource(),
                        filter));
View Full Code Here

    public abstract int getWidth(ImageObserver observer);

    public abstract int getHeight(ImageObserver observer);

    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

        return bufferedImage;
    }

    private BufferedImage makeColorTransparent(BufferedImage im, final Color color) {
        ImageFilter filter = new RGBImageFilter() {

            // the color we are looking for... Alpha bits are set to opaque
            public int markerRGB = color.getRGB() | 0xFF000000;

            @Override
View Full Code Here

        final int width = bi.getWidth();

        final BufferedImage imageOut = new BufferedImage(width * scale, (height * scale),
                BufferedImage.TYPE_BYTE_GRAY);

        final ImageFilter filter = new RGBImageFilter() {

            @Override
            public int filterRGB(final int x, final int y, final int rgb) {
                         
                final int rgb2 = rgb & 0xFF000000;
View Full Code Here

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

     * @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

     * @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

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

TOP

Related Classes of java.awt.image.ImageFilter

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.