Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By Fubarable

Thread: Help with morphing a picture

  1. #1
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default 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:
    Java 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();
         
        }
      }
    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default 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.
    DarrylBurke likes this.

  3. #3
    Stiamaa is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default 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.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

  5. #5
    Stiamaa is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default Re: Help with morphing a picture

    The Lines are:
    30. p1.morphStart(startPicture, endPicture, 5, 1);
    35. p2.morphStart(startPicture,endPicture, 5, 2);

Similar Threads

  1. Replies: 1
    Last Post: 05-24-2012, 04:44 PM
  2. Movie Picture Morphing
    By Mabyboi in forum Java 2D
    Replies: 1
    Last Post: 11-16-2011, 06:20 AM
  3. Replies: 2
    Last Post: 11-16-2011, 04:50 AM
  4. The Mystery of the auto-morphing variables
    By Luxpsycho in forum Advanced Java
    Replies: 3
    Last Post: 08-11-2011, 12:06 PM
  5. Morphing
    By aRTx in forum New To Java
    Replies: 4
    Last Post: 05-05-2009, 12:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •