Jump to content
  • 0
Sign in to follow this  
Final M G T

[PI] [317] Can't change the background of the client

Question

The source is SoulSplit found on rune-server, it has 40k+ views.
It doesnt have a ready Background.png at the spirites files.

At spirites.java it shows

[CODE]import sign.signlink;
import java.awt.*;
import java.awt.image.PixelGrabber;
import java.awt.image.*;
import javax.imageio.*;
import java.io.*;
import javax.swing.ImageIcon;

public final class Sprite extends DrawingArea {

public Sprite(int i, int j) {
myPixels = new int[i * j];
myWidth = anInt1444 = i;
myHeight = anInt1445 = j;
anInt1442 = anInt1443 = 0;
}


public String location = "C:/SoulSplit1/Sprites/";

public Sprite(byte abyte0[], Component component) {
try {
//Image image = Toolkit.getDefaultToolkit().getImage(location+"Background.png");
Image image = Toolkit.getDefaultToolkit().createImage(abyte0);
MediaTracker mediatracker = new MediaTracker(component);
mediatracker.addImage(image, 0);
mediatracker.waitForAll();
myWidth = image.getWidth(component);
myHeight = image.getHeight(component);
anInt1444 = myWidth;
anInt1445 = myHeight;
anInt1442 = 0;
anInt1443 = 0;
myPixels = new int[myWidth * myHeight];
PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
pixelgrabber.grabPixels();
} catch(Exception _ex) {
System.out.println("Error converting jpg");
}
}

public Sprite(String img, int width, int height) {
try {
Image image = Toolkit.getDefaultToolkit().createImage(FileOperations.ReadFile(img));
myWidth = width;
myHeight = height;
anInt1444 = myWidth;
anInt1445 = myHeight;
anInt1442 = 0;
anInt1443 = 0;
myPixels = new int[myWidth * myHeight];
PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
pixelgrabber.grabPixels();
image = null;
} catch(Exception _ex) {
System.out.println(_ex);
}
}

public Sprite(String img) {
try {
Image image = Toolkit.getDefaultToolkit().getImage(location + img + ".png");
ImageIcon sprite = new ImageIcon(image);
myWidth = sprite.getIconWidth();
myHeight = sprite.getIconHeight();
anInt1444 = myWidth;
anInt1445 = myHeight;
anInt1442 = 0;
anInt1443 = 0;
myPixels = new int[myWidth * myHeight];
PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
pixelgrabber.grabPixels();
image = null;
setTransparency(255, 0, 255);
} catch(Exception _ex) {
System.out.println(_ex);
}[/CODE]

I changed the mopar.jpg to my Background.png that i placed in my spirites folder, it is 744x504.png pic
After i compiled it still wont show me my background that i wanted.

I would appreciate help.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
[quote name='zillascape']I think your image has to be jpg[/QUOTE]
Nope :(

Share this post


Link to post
Share on other sites
  • 0
[quote name='Final M G T']Nope :([/QUOTE]

Just overwrite the original background file with your one? :D that should definitely work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×