| 131 | */ |
| 132 | threads[pageNumber] = new Thread() { |
| 133 | public void run() { |
| 134 | try { |
| 135 | System.out.println(pageNumber + ": creating pixmap"); |
| 136 | |
| 137 | /* Create a white destination pixmap with correct dimensions. */ |
| 138 | pixmaps[pageNumber] = new Pixmap(ColorSpace.DeviceRGB, bounds); |
| 139 | pixmaps[pageNumber].clear(0xff); |
| 140 | |
| 141 | System.out.println(pageNumber + ": rendering display list to pixmap"); |
| 142 | |
| 143 | /* Run the display list through a DrawDevice which |
| 144 | * will render the requested area of the page to the |
| 145 | * given pixmap. |
| 146 | */ |
| 147 | DrawDevice dev = new DrawDevice(pixmaps[pageNumber]); |
| 148 | displayList.run(dev, Matrix.Identity(), bounds, null); |
| 149 | dev.close(); |
| 150 | |
| 151 | } catch (RuntimeException ex) { |
| 152 | pixmaps[pageNumber] = null; |
| 153 | exceptions[pageNumber] = ex; |
| 154 | } |
| 155 | } |
| 156 | }; |
| 157 | |
| 158 | threads[pageNumber].start(); |