< prev index next >

src/java.desktop/share/classes/sun/awt/image/OffScreenImageSource.java

Print this page




 171             theConsumer.setColorModel(newcm);
 172 
 173             for (int y=0; y < height; y++) {
 174                 for (int x=0; x < width; x++) {
 175                     scanline[x] = image.getRGB(x, y);
 176                 }
 177                 theConsumer.setPixels(0, y, width, 1, newcm, scanline, 0,
 178                                       width);
 179             }
 180         }
 181     }
 182 
 183     private void produce() {
 184         try {
 185             theConsumer.setDimensions(image.getWidth(), image.getHeight());
 186             theConsumer.setProperties(properties);
 187             sendPixels();
 188             theConsumer.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
 189             theConsumer.imageComplete(ImageConsumer.STATICIMAGEDONE);
 190         } catch (NullPointerException e) {


 191             if (theConsumer != null) {
 192                 theConsumer.imageComplete(ImageConsumer.IMAGEERROR);



 193             }
 194         }
 195     }
 196 }


 171             theConsumer.setColorModel(newcm);
 172 
 173             for (int y=0; y < height; y++) {
 174                 for (int x=0; x < width; x++) {
 175                     scanline[x] = image.getRGB(x, y);
 176                 }
 177                 theConsumer.setPixels(0, y, width, 1, newcm, scanline, 0,
 178                                       width);
 179             }
 180         }
 181     }
 182 
 183     private void produce() {
 184         try {
 185             theConsumer.setDimensions(image.getWidth(), image.getHeight());
 186             theConsumer.setProperties(properties);
 187             sendPixels();
 188             theConsumer.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
 189             theConsumer.imageComplete(ImageConsumer.STATICIMAGEDONE);
 190         } catch (NullPointerException e) {
 191             e.printStackTrace();
 192             try {
 193                 if (theConsumer != null) {
 194                     theConsumer.imageComplete(ImageConsumer.IMAGEERROR);
 195                 }
 196             } catch (NullPointerException ex) {
 197                 ex.printStackTrace();
 198             }
 199         }
 200     }
 201 }
< prev index next >