Package java.awt.image

Examples of java.awt.image.RGBImageFilter


    }
    // 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;
          }

          @Override
View Full Code Here


          }
        });
      // Create a darker press icon
      setPressedIcon(new ImageIcon(createImage(new FilteredImageSource(
          ((ImageIcon)getIcon()).getImage().getSource(),
          new RGBImageFilter() {
            {
              canFilterIndexColorModel = true;
            }

            public int filterRGB (int x, int y, int rgb) {
View Full Code Here

         
          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;
                }
 
                public int filterRGB (int x, int y, int rgb) {
View Full Code Here

    }

    public static java.awt.Image makeGrayTransparent(byte[] imageData) {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        java.awt.Image img = toolkit.createImage(imageData);
        ImageFilter filter = new RGBImageFilter() {

                public final int filterRGB(int x, int y, int rgb)
                {
                    int r = (rgb & 0xFF0000) >> 16;
                    int g = (rgb & 0xFF00) >> 8;
View Full Code Here

        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

        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

    ImageIO.write(image, "JPG", file);
  }

  public static Image makeColorTransparent(Image image, Color color) {
    final Color testColor = color;
    RGBImageFilter filter = new RGBImageFilter() {
      // Alpha bits are set to opaque, regardless of what they
      // might have been already.
      public int markerRGB = testColor.getRGB() | 0xFF000000;

      public final int filterRGB(int x, int y, int rgb) {
View Full Code Here

        } catch (Exception e) {
            System.out.println("Error while loading pictures...");
            e.printStackTrace();
        }

        RGBImageFilter filter = new RGBImageFilter() {
            {
                canFilterIndexColorModel = true;
            }

            public int filterRGB(int x, int y, int rgb) {
View Full Code Here

import java.awt.image.ImageProducer;
import java.awt.image.RGBImageFilter;

public class Transparency {
    public static Image makeColorTransparent(Image 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
            public final int filterRGB(int x, int y, int rgb) {
View Full Code Here

TOP

Related Classes of java.awt.image.RGBImageFilter

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.