FileDocCategorySizeDatePackage
grab.javaAPI DocExample1312Mon Mar 24 01:59:14 GMT 1997None

grab

public class grab extends Applet

Fields Summary
Image
i
PixelGrabber
pg
Constructors Summary
Methods Summary
public voidinit()

        i = getImage (getDocumentBase(), "ora-icon.gif");
        pg  = new PixelGrabber (i, 0, 0, -1, -1, false);
        pg.startGrabbing();
        enableEvents (AWTEvent.MOUSE_EVENT_MASK);
    
public voidpaint(java.awt.Graphics g)

        g.drawImage (i, 10, 10, this);
    
protected voidprocessMouseEvent(java.awt.event.MouseEvent e)

        if (e.getID() == MouseEvent.MOUSE_CLICKED) {
            System.out.println ("Status: " + pg.getStatus());
            System.out.println ("Width:  " + pg.getWidth());
            System.out.println ("Height: " + pg.getHeight());
            System.out.println ("Pixels: " + 
                (pg.getPixels() instanceof byte[] ? "bytes" : "ints"));
            System.out.println ("Model:  " + pg.getColorModel());
        }
        super.processMouseEvent (e);