Package java.awt

Examples of java.awt.Toolkit.createImage()


    // If direction is RTL, flip the source image
    if (_isRightToLeft(context))
      producer = new FilteredImageSource(producer, new MirrorImageFilter());

    Image colorizedIcon =
      toolkit.createImage(new FilteredImageSource(producer, filter));

    // Be sure that the image is fully loaded
    ImageUtils.loadImage(colorizedIcon);

    // Get the width/height.  We use an ImageLoader object the ImageObserver
View Full Code Here


    // If direction is RTL, flip the source image
    if (_isRightToLeft(context))
      producer = new FilteredImageSource(producer, new MirrorImageFilter());

    Image flippedIcon =
      toolkit.createImage(producer);

    // Be sure that the image is fully loaded
    ImageUtils.loadImage(flippedIcon);

    // Get the width/height.  We use an ImageLoader object the ImageObserver
View Full Code Here

                    tmp = Image.getInstance(img, null);
                } else if (overrideTransparency == null || overrideTransparency.isEmpty()) {
                    tmp = Image.getInstance(getData());
                } else {
                    Toolkit toolkit = Toolkit.getDefaultToolkit();
                    java.awt.Image img = toolkit.createImage(getData());
                    tmp = Image.getInstance(img, Color.decode(overrideTransparency));
                }
            }
            if (cacheImage) {
                image = tmp;
View Full Code Here

        image.scaleToFit(scaleWidth, scaleHeight);
    }

    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;
View Full Code Here

                    return rgb;
                }       
        };

        ImageProducer ip = new FilteredImageSource(img.getSource(), filter);
        return toolkit.createImage(ip);
    }

}
View Full Code Here

    setFocusable(true);
    setAlwaysOnTop(true);
    addKeyListener(this);

    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

     */
    private synchronized Image loadImage(InputStream stream) throws IOException {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        byte data[] = FileCopyUtils.copyToByteArray(stream);

        Image image = toolkit.createImage(data);
        imageLoaded = false;
        imageError = false;
        // fully loads the image into memory
        toolkit.prepareImage(image, -1, -1, this);
        while (!imageLoaded && !imageError) {
View Full Code Here

        Thread t = new Thread() {
                public void run() {
                    Filter filt = null;

                    Toolkit tk = Toolkit.getDefaultToolkit();
                    Image img = tk.createImage(url);

                    if (img != null) {
                        RenderedImage ri = loadImage(img, dr);
                        if (ri != null) {
                            filt = new RedRable(GraphicsUtil.wrap(ri));
View Full Code Here

            /// Creates an invisble pointer by giving it bogus image
            /// Possibly find a workaround for this...
            Toolkit tk = Toolkit.getDefaultToolkit();
            byte bogus[] = { (byte) 0 };
            blankCursor =
              tk.createCustomCursor( tk.createImage( bogus ), new Point(0, 0), "" );

            zoomWindow = new JWindow( parent ) {
                public void paint( Graphics g ) {
                    g.drawImage( zoomImage, 0, 0, zoomWindow );
                }
View Full Code Here

    {
      image.getPackedBytes(0, y, width, row, 0, 0);
      RGBA.convertFromPackedBilevel(row, 0, alpha, pixels, destOffset, width);
      destOffset += width;
    }
    return toolkit.createImage(new MemoryImageSource(width, height, pixels, 0, width));
  }

  /**
   * Creates an AWT Image object from a Gray16Image object and an alpha value.
   * This is done by allocating a new int array with image.getWidth() times
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.