Package java.awt

Examples of java.awt.Toolkit.createImage()


    {
      image.getShortSamples(0, 0, y, width, 1, gray, 0);
      RGBA.convertFromGray16(gray, 0, alpha, pixels, destOffset, width);
      destOffset += width;
    }
    return toolkit.createImage(new MemoryImageSource(width, height, pixels, 0, width));
  }

  /**
   * Creates an AWT Image object from a Gray8Image object and an alpha value.
   * This is done by allocating a new int array with image.getWidth() times
View Full Code Here


    {
      image.getByteSamples(0, 0, y, width, 1, gray, 0);
      RGBA.convertFromGray8(gray, 0, alpha, pixels, destOffset, width);
      destOffset += width;
    }
    return toolkit.createImage(new MemoryImageSource(width, height, pixels, 0, width));
  }

  public static Image convertToAwtImage(Paletted8Image image, int alpha)
  {
    if (image == null)
View Full Code Here

    {
      image.getByteSamples(0, 0, y, width, 1, data, 0);
      RGBA.convertFromPaletted8(data, 0, alpha, red, green, blue, pixels, destOffset, width);
      destOffset += width;
    }
    return toolkit.createImage(new MemoryImageSource(width, height, pixels, 0, width));
   
  }

  public static Image convertToAwtImage(RGB24Image image, int alpha)
  {
View Full Code Here

      image.getByteSamples(RGBIndex.INDEX_GREEN, 0, y, width, 1, green, 0);
      image.getByteSamples(RGBIndex.INDEX_BLUE, 0, y, width, 1, blue, 0);
      RGBA.convertFromRGB24(red, 0, green, 0, blue, 0, alpha, pixels, destOffset, width);
      destOffset += width;
    }
    return toolkit.createImage(new MemoryImageSource(width, height, pixels, 0, width));
   
  }

  public static Image convertToAwtImage(RGB48Image image, int alpha)
  {
View Full Code Here

      image.getShortSamples(RGBIndex.INDEX_GREEN, 0, y, width, 1, green, 0);
      image.getShortSamples(RGBIndex.INDEX_BLUE, 0, y, width, 1, blue, 0);
      RGBA.convertFromRGB48(red, 0, green, 0, blue, 0, alpha, pixels, destOffset, width);
      destOffset += width;
    }
    return toolkit.createImage(new MemoryImageSource(width, height, pixels, 0, width));
  }

  /**
   * Creates an {@link RGB24Image} from the argument AWT image instance.
   * @param image AWT image object to be converted to a {@link RGB24Image}
View Full Code Here

        }
       
        buffer = bos.toByteArray();

        Toolkit tk = Toolkit.getDefaultToolkit();
        final Image img = tk.createImage(buffer);
        if (img == null) {
            return null;
        }

        RenderedImage ri = loadImage(img);
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), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
    buffered.getGraphics().drawImage(image, 0, 0, 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), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
    buffered.getGraphics().drawImage(image, 0, 0, null);
View Full Code Here

            // a workaround:
            // setIconImage(new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB));
            // Another thing to check for is whether the icon is in the
            // same directory as TableauFrame.class
            Toolkit tk = Toolkit.getDefaultToolkit();
            _defaultIconImage = tk.createImage(url);
        }

        return _defaultIconImage;
    }
View Full Code Here

    buttonPanel.add(yellowButton);

    add(buttonPanel);

    Toolkit tk = Toolkit.getDefaultToolkit();
    Image img = tk.createImage("Texture/cursor.png");
    Cursor cursor = tk.createCustomCursor(img, new Point(8, 8),
        "/Texture/cursor.png");
    this.setCursor(cursor);
  }
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.