Problems splitting an image strip
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mark_Whitehouse
Posted On:   Thursday, December 13, 2001 06:02 AM

I had an applet working just fine locally and on the http server. But now I've put all the gif images into 1 gif file I can't get them to display. The applet doesn't crash, it just doesn't display the images. I set up the Images like this... private void LoadImages() { Image main = getImage(codebase, "images.gif"); MediaTracker track = new MediaTracker(this); track.addImage(main,0); try { track.waitForAll(0); }catch(InterruptedException e) { System.out.println(e); } bkg = getPicky(main, 0,0,683,599); sl = getPicky(main, 366, 686, 75, 75); sn = getPicky(main, 549, 478, 75, 75); sp = getPicky(main, 446, 686, 7   More>>

I had an applet working just fine locally and on the http server. But now I've put all the gif images into 1 gif file I can't get them to display.

The applet doesn't crash, it just doesn't display the images. I set up the Images like this...

			
private void LoadImages() {

Image main = getImage(codebase, "images.gif");
MediaTracker track = new MediaTracker(this);

track.addImage(main,0);
try {
track.waitForAll(0);
}catch(InterruptedException e) {
System.out.println(e);
}

bkg = getPicky(main, 0,0,683,599);
sl = getPicky(main, 366, 686, 75, 75);
sn = getPicky(main, 549, 478, 75, 75);
sp = getPicky(main, 446, 686, 75, 75);
cl = getPicky(main, 46, 686, 75, 75);
cn = getPicky(main, 52, 478, 75, 75);
cp = getPicky(main, 126, 686, 75, 75);
hl = getPicky(main, 206, 686, 75, 75);
hn = getPicky(main, 264, 478, 75, 75);
hp = getPicky(main, 286, 686, 75, 75);

nudgeBannerOn = getPicky(main, 545, 615, 70, 36);
nudgeBannerOff = getPicky(main, 41, 131, 70, 36);
n1On = getPicky(main, 545, 851, 70, 67);
n1Off = getPicky(main, 41, 367, 70, 67);
n2On = getPicky(main, 545, 783, 70, 68);
n2Off = getPicky(main, 41, 299, 70, 68);
n3On = getPicky(main, 545, 718, 70, 66);
n3Off = getPicky(main, 41, 234, 70, 66);
n4On = getPicky(main, 545, 651, 70, 67);
n4Off = getPicky(main, 41, 167, 70, 67);

}

private Image getPicky(Image strip, int x, int y, int width, int height) {

ImageProducer sourceProducer, filterProducer;
ImageFilter filter;
sourceProducer = strip.getSource();
filter = new CropImageFilter(x, y, width, height);
filterProducer = new FilteredImageSource(sourceProducer, filter);

return createImage(filterProducer);
}


anyone got any ideas ?
(please help I need this quite urgently and i been on it for ages)    <<Less
About | Sitemap | Contact