Creating a 3x3 matrix of imgs
this is alot easier in objective-c language. but Java class and method throw me off track a bit or it might be the syntax. im not sure.
so i create a array of images like soo
Code:
static Image[] imgs;
than i init the array by doing soo
Code:
imgs = new Image[9];
than declare the base URL like soo
Code:
URL b_url = null;
try {
b_url = new URL("/home/user/pic/");
}
catch (java.net.MalformedURLException ex){}
than use a for loop for assignment if array like so
Code:
int part;
for(int i = 0; i<=9; i++){
part = i;
String f_name = "pic_"+part+".jpg";
imgs[i] = getImage(b_url, f_name);
}
than i would have to think of a simple algorithm to correctly place the image parts in the "frame".
i do realize that i have to override the paint().
soo like somthing like this
Code:
public void paint(Graphics g){
int x = 0;
int y = 0;
for(int i =0; i <=9; i++){
g.drawImage(imgs[i], x, y, null);
x = x +100;
y = y+ 100;
}
}
now i have a theorized concept of how i can make this work but i have a hard time getting out of my mind and transmitting it to the dam keyboard to the computer. may some please fill my blanks.:confused:
(i wish their wasn't so many classes for one objective)
NSImage = every thing about images (obj-c)
Image, BufferedImage, ImageIO, and more (java)