// Texture.java import java.applet.Applet; import java.awt.image.ImageObserver; import java.awt.image.PixelGrabber; public class Texture { public Texture () {} public Texture (Applet applet, String s, int i, int j) { load (applet, s, i, j); } public boolean load (Applet applet, String s, int i, int j) { size = i * j; pixels = new int[size]; width = i; height = j; try { java.awt.Image image = applet.getImage (applet.getDocumentBase (), s); PixelGrabber pg = new PixelGrabber (image, 0, 0, i, j, pixels, 0, i); pg.grabPixels (); return (pg.getStatus () & 0x80) == 0; } catch (Throwable _ex) {return false;} } public int pixels[], width, height, size; }