Help with morphing a picture
This was asked to me in a private message by the new forum member, Stiamaa. As a favor to him and to comply with forum protocol, I am going to post his question here in the public New To Java forum:
Quote:
Originally Posted by Stiamaa
Hey, I just wanted to ask if you can help me with my morph?
I've been trying to invoke it, and I've looked at other websites and post to see what was wrong.
His code:
Code:
public class TestMorphing
{
public static void main(String[] args)
{
String start = FileChooser.pickAFile();
Picture startPicture = new Picture(start);
int startWidth = startPicture.getWidth();
int startHeight = startPicture.getHeight();
String end = FileChooser.pickAFile();
Picture endPicture = new Picture(end);
int endWidth = endPicture.getWidth();
int endHeight = endPicture.getHeight();
if(startWidth != endWidth || startHeight != endHeight)
{
SimpleOutput.showInformation("Files are not the same size.");
}
else
{
int rate = SimpleInput.getIntNumber("Enter int Number: ");
Picture[] pictureArray;
pictureArray = new Picture[rate + 2];
pictureArray[0] = startPicture;
pictureArray[pictureArray.length - 1] = endPicture;
Picture p1 = new Picture();
p1.morphStart(startPicture, endPicture, 5, 1);
pictureArray[1] = p1;
pictureArray[1].show();
Picture p2 = new Picture();
p2.morphStart(startPicture,endPicture, 5, 2);
pictureArray[2] = p2;
pictureArray[2].show();
}
}
}
Re: Help with morphing a picture
I suggest that you tell us more about exactly what problems you are having with this code -- does it compile? Does it run? Are you seeing any error messages or exceptions? If it runs, is it not behaving properly? The more information you can share with us, the better we can help you. I also encourage you to not ask questions like these in a private manner but to ask them in the forum for all to share, all to help with, and all to learn from.
Re: Help with morphing a picture
Sorry about that, and next time I will answer with by asking on the public forum. I tried compiling, but line 30 and 35, it cannot find the symbol.
Re: Help with morphing a picture
Which lines are 30 and 35?
Re: Help with morphing a picture
The Lines are:
30. p1.morphStart(startPicture, endPicture, 5, 1);
35. p2.morphStart(startPicture,endPicture, 5, 2);