Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JAI problem of creating compound image from slices

Reply
Thread Tools

JAI problem of creating compound image from slices

 
 
Apc
Guest
Posts: n/a
 
      06-02-2004
Hi,
I am trying to create a compound image from 16 slices.I finished
loading the images and it displays .But i want it to make it as a
compound image so that can it be scaled ,moved etc.Can anyone please
let me know how to do it
The code is given below








public class Acquire extends Applet {

int x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14, x15;
int y0,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14, y15;
Image[] images = new Image[16];

public void init() {
images[0] = getImage(getDocumentBase(), "0_gr.gif");
PlanarImage input0 = JAI.create("fileload", "0_gr.gif");
y0=input0.getHeight();
x0= input0.getWidth();

images[1] = getImage(getDocumentBase(), "1_gr.gif");
PlanarImage input1 = JAI.create("fileload", "1_gr.gif");
y1=input1.getHeight();
x1= input1.getWidth();



images[2] = getImage(getDocumentBase(), "2_gr.gif");
PlanarImage input2 = JAI.create("fileload", "2_gr.gif");
y2=input2.getHeight();
x2= input2.getWidth();


images[3] = getImage(getDocumentBase(), "3_gr.gif");
PlanarImage input3 = JAI.create("fileload", "3_gr.gif");
y3=input3.getHeight();
x3= input3.getWidth();

images[4] = getImage(getDocumentBase(), "4_gr.gif");
PlanarImage input4 = JAI.create("fileload", "4_gr.gif");
y4=input4.getHeight();
x4= input4.getWidth();


images[5] = getImage(getDocumentBase(), "5_gr.gif");
PlanarImage input5 = JAI.create("fileload", "5_gr.gif");
y5=input5.getHeight();
x5= input5.getWidth();


images[6] = getImage(getDocumentBase(), "6_gr.gif");
PlanarImage input6 = JAI.create("fileload", "6_gr.gif");
y6=input6.getHeight();
x6= input6.getWidth();


images[7] = getImage(getDocumentBase(), "7_gr.gif");
PlanarImage input7 = JAI.create("fileload", "7_gr.gif");
y7=input7.getHeight();
x7= input7.getWidth();


images[8] = getImage(getDocumentBase(), "8_gr.gif");
PlanarImage input8 = JAI.create("fileload", "8_gr.gif");
y8=input8.getHeight();
x8= input8.getWidth();


images[9] = getImage(getDocumentBase(), "9_gr.gif");
PlanarImage input9 = JAI.create("fileload", "9_gr.gif");
y9=input9.getHeight();
x9= input9.getWidth();


images[10] = getImage(getDocumentBase(), "10_gr.gif");
PlanarImage input10 = JAI.create("fileload", "10_gr.gif");
y10=input10.getHeight();
x10= input10.getWidth();


images[11] = getImage(getDocumentBase(), "11_gr.gif");
PlanarImage input11 = JAI.create("fileload", "11_gr.gif");
y11=input11.getHeight();
x11= input11.getWidth();

images[12] = getImage(getDocumentBase(), "12_gr.gif");
PlanarImage input12 = JAI.create("fileload", "12_gr.gif");
y12=input12.getHeight();
x12= input12.getWidth();

images[13] = getImage(getDocumentBase(), "13_gr.gif");
PlanarImage input13 = JAI.create("fileload", "13_gr.gif");
y13=input13.getHeight();
x13= input13.getWidth();

images[14] = getImage(getDocumentBase(), "14_gr.gif");
PlanarImage input14 = JAI.create("fileload", "14_gr.gif");
y14=input14.getHeight();
x14= input14.getWidth();

images[15] = getImage(getDocumentBase(), "15_gr.gif");
PlanarImage input15 = JAI.create("fileload", "15_gr.gif");
y15=input15.getHeight();
x15= input15.getWidth();




}
public void paint(Graphics g) {
// Draw image
g.drawImage(images[0], 0, 0, this);
g.drawImage(images[1], x0, 0, this);
g.drawImage(images[2], x0+x1, 0, this);
g.drawImage(images[3], x0+x1+x2, 0, this);
g.drawImage(images[4],0,y0,this);
g.drawImage(images[5], x4,y0,this);
g.drawImage(images[6], x4+x5, y0, this);
g.drawImage(images[7], x4+x5+x6, y0, this);
g.drawImage(images[8], 0, y0+y4, this);
g.drawImage(images[9], x8,y0+y4,this);
g.drawImage(images[10], x9+x8, y0+y4, this);
g.drawImage(images[11], x10+x8+x9, y0+y4, this);
g.drawImage(images[12], 0, y0+y4+y8, this);
g.drawImage(images[13], x12,y0+y4+y8,this);
g.drawImage(images[14], x12+x13, y0+y4+y8, this);
g.drawImage(images[15], x12+x13+x14, y0+y4+y8, this);
ParameterBlock pb=new ParameterBlock();



}

}
 
Reply With Quote
 
 
 
 
ak
Guest
Posts: n/a
 
      06-02-2004
> I am trying to create a compound image from 16 slices.I finished
> loading the images and it displays .But i want it to make it as a
> compound image so that can it be scaled ,moved etc.Can anyone please
> let me know how to do it

the advantage of JAI allows you to mantain HUGE images.
Why create 16 slices if you can just load full image?
Very powerful component for displaying such huge (tested with 2 GB) images
is JadeDisplay.
For more info see http://www.openchannelfoundation.org...s/JadeDisplay/

search JAI archives for more info how to compose images
http://swjscmail1.sun.com/archives/jai-interest.html

--
http://uio.dev.java.net
http://reader.imagero.com


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem - creating a tiled image from multiple tiff sources in JAI voncroy14 Java 0 07-17-2009 10:17 AM
problem with creating JAI grayscale image Java_New Java 5 05-27-2006 03:24 PM
Creating tiled image from multiple tiff sources in JAI Michael David Pedersen Java 2 07-22-2004 09:59 PM
positioning image slices CSS-style bulge HTML 8 07-19-2004 12:15 PM
Importing Image Slices into JAVA Apc Java 1 06-02-2004 04:36 AM



Advertisments