Results 1 to 1 of 1
- 01-20-2010, 08:01 AM #1
Member
- Join Date
- Mar 2008
- Posts
- 15
- Rep Power
- 0
using mosaic to stitch bufferedimage
hi all,
i know using mosaic can stitch images read from file by adding them to vector, but if i didn't export the bufferedimage to image files, by passing them directly to vector instead, i got vector grows in size and finally got outofmemory error, this maybe because jai load file to renderedimage which point to the image file so it doesn't consume much space. so now the problem is how can i stitch images by not writing tiled images files to disk? here is the code:
Vector renderedOps = new Vector();
RenderedImage op;
for(int y=0;y<ny;y++){
for(int x=0;x<nx;x++){
op = JAI.create("fileload",".//sub tif//"x"_"y".TIF");
op = TranslateDescriptor.create(op,(float)(width),(floa t)(height),null,null);
renderedOps.add(op);
RenderedOp finalImage = MosaicDescriptor.create((RenderedImage[])renderedOps.toArray(new RenderedOp[renderedOps.size()]),MosaicDescriptor.MOSAIC_TYPE_OVERLAY,null,null,n ull,null,null);
if(x=100)
ImageIO.write(finalImage, "TIFF", new File("c:\\out.tif"));
}
thank you!
Similar Threads
-
Using BufferedImage
By timkd127 in forum New To JavaReplies: 5Last Post: 12-19-2009, 09:17 PM -
BufferedImage imageScaling
By MINGxDOG in forum New To JavaReplies: 2Last Post: 11-17-2009, 03:04 PM -
BufferedImage through FTP
By dudejonne in forum New To JavaReplies: 7Last Post: 11-05-2009, 05:36 PM -
Converting BufferedImage Into ImageIcon
By hitmen in forum AWT / SwingReplies: 9Last Post: 03-25-2009, 08:10 AM -
BufferedImage to Byte
By Java Tip in forum Java TipReplies: 0Last Post: 01-22-2008, 08:17 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks