home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Image;
- import java.awt.image.PixelGrabber;
- import java.net.URL;
-
- public class BannerData {
- public URL link;
- public Image image;
- public int[] imagePixels;
-
- public BannerData(URL link, Image image) {
- this.link = link;
- this.image = image;
- }
-
- public void initPixels(int imageWidth, int imageHeight) {
- this.imagePixels = new int[imageWidth * imageHeight];
- PixelGrabber pixelGrabber = new PixelGrabber(this.image.getSource(), 0, 0, imageWidth, imageHeight, this.imagePixels, 0, imageWidth);
-
- try {
- pixelGrabber.grabPixels();
- } catch (InterruptedException var6) {
- }
- }
- }
-