Package java.awt.image

Examples of java.awt.image.MemoryImageSource


    SystemTray tray = SystemTray.getSystemTray();
    int w = 80;
    int[] pix = new int[w*w];
    for (int i=0; i< w*w; i++ )
      pix [i]=(int)(Math.random ()*255);
    ImageProducer producer = new MemoryImageSource ( w,w,pix,0,w );
    Image  image = Toolkit.getDefaultToolkit().createImage(producer);
    TrayIcon trayIcon = new TrayIcon(image);
    trayIcon.setImageAutoSize(true);
    startWindow();
    try
View Full Code Here


        int[] pixels = (int[]) (s.readObject());

        if (pixels != null) {
            Toolkit tk = Toolkit.getDefaultToolkit();
            ColorModel cm = ColorModel.getRGBdefault();
            image = tk.createImage(new MemoryImageSource(w, h, cm, pixels, 0, w));
            loadImage(image);
        }
    }
View Full Code Here

    }

    public MemoryImageSource getImageSource()
    {
        ColorModel cm;
        MemoryImageSource mis;
        if (noOfEntries > 0)
        {
            // There is a color palette; create an IndexColorModel
            cm = new IndexColorModel(bitsPerPixel, noOfEntries, r, g, b);
        }
        else
        {
            // There is no palette; use the default RGB color model
            cm = ColorModel.getRGBdefault();
        }
        // Create MemoryImageSource
        if (bitsPerPixel > 8)
        {
            // use one int per pixel
            mis = new MemoryImageSource(width, height, cm, intData, 0, width);
        }
        else
        {
            // use one byte per pixel
            mis = new MemoryImageSource(width, height, cm, byteData, 0, width);
        }
        return mis; // this can be used by JComponent.createImage()
    }
View Full Code Here

            catch (InterruptedException e)
            {
            }
        }
        /*-- We create the final Image Banner throught an Image --*/
        theBanner = createImage(new MemoryImageSource(theText.length() * fontW, fontH, pixels, 0, theText.length() * fontW));
    }
View Full Code Here

        for (int j = 0; j < block; j++) {
          pix[0][i * block + j] = color;
          pix[1][j * block + i] = color;
        }
      }
      hgradient = createImage(new MemoryImageSource(block, block, pix[0], 0, block));
      vgradient = createImage(new MemoryImageSource(block, block, pix[1], 0, block));
    }
    //g.setColor(Color.orange);
    //g.fillRect(0, 0, getSize().width, getSize().height);
    //long time = System.currentTimeMillis();
    Rectangle clip = g.getClipBounds();
View Full Code Here

        util.setLayout(null);
      }

      for(BNetIcon bni : icons) {
        // AWT
        bni.awt_image = util.createImage(new MemoryImageSource(bni.xSize, bni.ySize, pixelData, currentPixel, bni.xSize));
        bni.icon = new ImageIcon(bni.awt_image);

        // SWT
        try {
          int pos = 0;
View Full Code Here

        final byte[] r = new byte[] { 0, 127 };
        final byte[] g = new byte[] { 0, 127 };
        final byte[] b = new byte[] { 0, 127 };
        final IndexColorModel colorModel = new IndexColorModel(1, 2, r, g, b);

        final MemoryImageSource producer = new MemoryImageSource(128, 128, colorModel, pixels, 0, 128);
        final Image image = Toolkit.getDefaultToolkit().createImage(producer);

        return image;
    }
View Full Code Here

     *
     */
    public void main() {

        fMain = new Frame("HSQL Database Manager");
        imgEmpty = createImage(new MemoryImageSource(2, 2, new int[4 * 4], 2,
                2));

        fMain.setIconImage(imgEmpty);
        fMain.addWindowListener(this);

View Full Code Here

        int offset = 0;
        for (int line = 0; line < lines; line++) {
            System.arraycopy(pixels[line], 0, pix, offset, width);
            offset += width;
        }
        final MemoryImageSource source = new MemoryImageSource(width, lines, pix, 0, width);
        return java.awt.Toolkit.getDefaultToolkit().createImage(source);
    }
View Full Code Here

                }
                egoDataOffset++;
            }
        }
       
        return Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(width, height, ColorModel.getRGBdefault(), rgbPixelData, 0, width));
    }
View Full Code Here

TOP

Related Classes of java.awt.image.MemoryImageSource

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.