d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Homework Assignment > You Up For It?
Prev12
Add Reply New Topic New Poll
Member
Posts: 2,458
Joined: Sep 20 2009
Gold: 10,110.50
Mar 18 2014 07:21pm
Quote (Minkomonster @ Mar 18 2014 09:10pm)
I dont know what methods the Picture class or the Pixel class have. I took an educated guess with the getColor() method on the Pixel class and the setColor method on the Pixel class.


I will work with it, thanks. Would you be willing to help me with the second part of this assignment? :baby:



Part B:
Movies are essentially sequences of pictures that are typically displayed at 24 “frames” per second, each frame being a single picture. To create the effect of fading through a solid colour (fade out from one image and then fade in to another) as seen in videos and commercials, we would need to produce many more images and then play them in rapid succession, thus creating a video in which one image fades through a solid colour and then into the other. You will make use of the FrameSequencer and MoviePlayer classes provided with our textbook in order to create and display a movie. The FrameSequencer class has methods that will take a sequence of pictures and store them in a directory; the pictures can then be displayed in rapid succession, thereby creating a “movie”. The MoviePlayer class has methods to play back a sequence of pictures already created (e.g. by FrameSequencer).
Here is sample code to create a FrameSequencer object that will store the movie frames in the directory referenced by a String variable directoryName, created from an array of pictures referenced by a Picture[] variable pictureSequence: FrameSequencer frameSequencer = new FrameSequencer(directoryName); for (int i = 0; i < pictureSequence.length; i++) { frameSequencer.addFrame(pictureSequence[i]); }
Once a movie has been made with FrameSequencer, we can use the MoviePlayer class to show the movie.

The MoviePlayer class
A MoviePlayer object plays an existing movie. Here are the important details about this class:
• The constructor for a MoviePlayer object takes as a parameter a String that is the name of a directory containing the images to be displayed in the movie
• The playMovie() method opens a window in which it then displays the movie. If the playMovie() method is called without a parameter, it plays the movie at high speed. It can also accept an int parameter that specifies the number of frames to be displayed per second. So to play a movie, we create a MoviePlayer object and invoke the playMovie() method on it as we see in the code here: MoviePlayer movie = new MoviePlayer(directoryName); movie.playMovie();

Functional Specifications for Part B
1. You will create and play your movies in a Java program with the class name FadingMovie that will be saved in a file named FadingMovie.java. This class will consist primarily of a main method whose algorithm is given below.
2. The algorithmic specifications for the main method are:
• Get the starting picture and ending picture for the fading, using FileChooser to get the file names. If the starting picture and ending picture are not the same size, print an error message and do not proceed with the rest of the program. (Use the showInformation() method of the SimpleOutput class for your error message. )
• Get the number of intermediate stages for both fades from the user (using the SimpleInput class).
• Have a colour to fade through hard coded into your program using a constant.
• Input the name of the directory in which to store the movie (using the SimpleInput class). Note: that the directory name that you enter should end with a slash, for example Z:/Movie1/
• Create an array of Picture objects that will hold the sequence of pictures for the fading (Note: its length should include both the fade out of one image and the fade in of the other. There should only be ONE frame of solid colour in the “center” of the array)
• Store the starting and ending pictures in the array.
• Create intermediate pictures in the array, using loops and the fadeOut() and fadeIn() methods
from Part A. Each image must also be the same size as the start/end images.
• Create a movie from the array of pictures you have completed using a FrameSequencer object (see above).
• Play the movie using a MoviePlayer object and playMovie().
• Now create the second movie (which fades from the starting picture to the ending picture and back again to the starting picture). You can do this in either of two ways:
i. Add the “backwards” fading sequence to the same directory ( in which case you no longer will be able to play your first movie)
ii. Use a new directory for all the frames of the second movie. You would then input the directory name for this movie from the user.
• Play the second movie.


I will pay for your help, if that's any incentive. :hail:
Member
Posts: 2,458
Joined: Sep 20 2009
Gold: 10,110.50
Mar 18 2014 07:32pm
If this helps, we import these into our picture class

import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.text.*;
Member
Posts: 2,458
Joined: Sep 20 2009
Gold: 10,110.50
Mar 18 2014 07:36pm
Code

import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.text.*;

/**
* A class that represents a picture. This class inherits from
* SimplePicture and allows the student to add functionality to
* the Picture class.
*
* Copyright Georgia Institute of Technology 2004-2005
* @author Barbara Ericson ericson@cc.gatech.edu
*/
public class Picture extends SimplePicture
{
///////////////////// constructors //////////////////////////////////

/**
* Constructor that takes no arguments
*/
public Picture ()
{
/* not needed but use it to show students the implicit call to super()
* child constructors always call a parent constructor
*/
super();
}

/**
* Constructor that takes a file name and creates the picture
* @param fileName the name of the file to create the picture from
*/
public Picture(String fileName)
{
// let the parent class handle this fileName
super(fileName);
}

/**
* Constructor that takes the width and height
* @param width the width of the desired picture
* @param height the height of the desired picture
*/
public Picture(int width, int height)
{
// let the parent class handle this width and height
super(width,height);
}

/**
* Constructor that takes a picture and creates a
* copy of that picture
*/
public Picture(Picture copyPicture)
{
// let the parent class do the copy
super(copyPicture);
}

////////////////////// methods ///////////////////////////////////////
//WHILE LOOP
public void filter1()
{
Pixel[] pixelArray = this.getPixels();
Pixel pixelObj = null;
int index = 0;
int value = 0;
while (index < pixelArray.length)
{
pixelObj = pixelArray[index];
value = pixelObj.getRed();
value = value*2;
pixelObj.setRed(value);
index = index + 1;
}
}
public void filter4()
{
Pixel[] pixelArray = this.getPixels();
Pixel pixelObj = null;
int index = 0;
int value = 0;
while(index < pixelArray.length)
{
pixelObj = pixelArray[index];
value = pixelObj.getRed();
pixelObj.setRed((int) (value *3));
value = pixelObj.getGreen();
pixelObj.setGreen((int) (value *1));
index = index + 1;
}
}

//FOR LOOP
public void filter2()
{
Pixel[] pixelArray = this.getPixels();
Pixel pixelObj2 = null;
int intensity = 0;
for (int i = 0; i < pixelArray.length; i++)
{
pixelObj2 = pixelArray[i];
intensity = (pixelObj2.getRed() + pixelObj2.getGreen() + pixelObj2.getBlue()) / 3;
pixelObj2.setColor(new Color(intensity, intensity, intensity));
}
}
public void filter3()
{
Pixel pixelObj1 = null;
Pixel[] pixelArray1 = this.getPixels();
int red, blue, green = 0;
for (int i = 0; i < pixelArray1.length; i++)
{
pixelObj1 = pixelArray1[i];
red = pixelObj1.getRed();
green = pixelObj1.getGreen();
blue = pixelObj1.getBlue();
pixelObj1.setColor(new Color(255-red, 255-green, 255-blue));
}
}
/**
* Method to return a string with information about this picture.
* @return a string with information about the picture such as fileName,
* height and width.
*/
public String toString()
{
String output = "Picture, filename " + getFileName() +
" height " + getHeight()
+ " width " + getWidth();
return output;

}

/*****************************************************************
* Method to mirror a piece of the temple
*****************************************************************/
public void mirrorTemple(){
//Declare local variables
int mirrorPoint = 276;
Pixel leftPix = null;
Pixel rightPix = null;

//Loop through all rows, where the temple must be mirrored
for (int y=27;y<97;y++){
for (int x=13; x<mirrorPoint; x++){
leftPix = getPixel(x,y); //get left pixel (good pixel)
//Get right pixel (the mirror location)
rightPix = getPixel(mirrorPoint + (mirrorPoint-x),y);
//Swap the colours
rightPix.setColor(leftPix.getColor());
}
}
}


/*****************************************************************
* Mirror a picture vertically
*****************************************************************/
/* public void mirrorVertical()
{
int mirrorPoint = this.getWidth()/2;
Pixel leftPixel = null;
Pixel rightPixel = null;

// loop through the rows
for (int y = 0; y < this.getHeight(); y++)
{
// loop from column 0 to just before the mirror point
for (int x = 0; x < mirrorPoint; x++)
{ leftPixel = this.getPixel(x,y);
rightPixel = this.getPixel(this.getWidth()-1-x, y);
rightPixel.setColor(leftPixel.getColor());
}
}
} */
/* public void mirrorVerticalRightToLeft()
{
int mirrorPoint = this.getWidth()/2;
Pixel leftPixel = null;
Pixel rightPixel = null;

// loop through the rows
for (int y = 0; y < this.getHeight(); y++)
{
// loop from column 0 to just before the mirror point
for (int x = 0; x < mirrorPoint; x++)
{ leftPixel = this.getPixel(x,y);
rightPixel = this.getPixel(this.getWidth()-1-x, y);
leftPixel.setColor(rightPixel.getColor());
}
}
} */
public void mirrorDiagonal()
{
Pixel leftPixel = null;
Pixel rightPixel = null;

// loop through the rows
for (int x = 0; x < this.getWidth(); x++)
{
// loop from column 0 to just before the mirror point
for (int y = 0; y <=x; y++)
{ leftPixel = this.getPixel(x,y);
rightPixel = this.getPixel(y,x);
rightPixel.setColor(leftPixel.getColor());
}
}
}


/*****************************************************************
* Method to make a picture greyscale
*****************************************************************/
public void goodGrey(){
//Declare local variables; get an array of pixels out of the picture
Pixel[] pixelArray = this.getPixels();
Pixel pix = null;
int luminance = 0;
double redV = 0;
double blueV= 0;
double greenV= 0;

//Loop through all pixels in the array
for (int i=0; i<pixelArray.length;i++){
pix = pixelArray[i];
redV = pix.getRed() * 0.299;
blueV = pix.getBlue() * 0.587;
greenV = pix.getGreen() * 0.114;
luminance = (int)(redV + greenV + blueV);
//Change pixel colour to the new colour created using luminance
pix.setColor(new Color(luminance, luminance, luminance));
}
}

/***************************************
** Copy picture ***
****************************************/

public void copyPicture (Picture sourcePicture)
{
Pixel sourcePixel = null;
Pixel targetPixel = null;
// loop through the columns
for (int sourceX = 0, targetX = 0;
sourceX < sourcePicture.getWidth();
sourceX++, targetX++)
{ // loop through the rows
for (int sourceY = 0, targetY = 0;
sourceY < sourcePicture.getHeight();
sourceY++, targetY++)
{
// set the target pixel color to the source pixel color
sourcePixel = sourcePicture.getPixel(sourceX,sourceY);
targetPixel = this.getPixel(targetX,targetY);
targetPixel.setColor(sourcePixel.getColor());
}
}
}


/**
* Modified version of method from page 154 of the textbook for copying pictures
*/

public void copyPictureTo(Picture sourcePicture, int xStart, int yStart)
{
Pixel sourcePixel = null;
Pixel targetPixel = null;

//loop through the columns
try{
for (int sourceX = 0, targetX = xStart;
sourceX < sourcePicture.getWidth();
sourceX++, targetX++)
{
//loop through the rows
for (int sourceY = 0,
targetY = yStart;
sourceY < sourcePicture.getHeight();
sourceY++, targetY++)
{
sourcePixel = sourcePicture.getPixel(sourceX,sourceY);
targetPixel = this.getPixel(targetX,targetY);
if(sourcePixel.getRed()!=255 && sourcePixel.getGreen()!=255 && sourcePixel.getBlue() != 255)
{
targetPixel.setColor(sourcePixel.getColor());
}
}
}
}catch(IndexOutOfBoundsException ex){System.out.println("Either xStart or yStart is out of bounds");System.exit(0);}
}

public void copyExceptWhite(Picture sourcePicture, int xStart, int yStart)
{
Pixel sourcePixel = null;
Pixel targetPixel = null;
Picture targetPicture = new Picture(this.getWidth(), this.getHeight());
//loop through the columns

for (int sourceX = 0, targetX = xStart; sourceX < sourcePicture.getWidth(); sourceX++, targetX++)
{
//loop through the rows
for (int sourceY = 0, targetY = yStart; sourceY < sourcePicture.getHeight(); sourceY++, targetY++)
{
sourcePixel = sourcePicture.getPixel(sourceX,sourceY);
targetPixel = this.getPixel(targetX,targetY);
targetPixel.setColor(sourcePixel.getColor());
}
if (sourcePixel.getRed() + sourcePixel.getGreen() + sourcePixel.getBlue() < 0)
{
Picture copyTargetPicture = new Picture (this.getWidth(), this.getHeight());
}
}
}
public void blueExtremes(){
//Local variables
Pixel[] pixelArray = this.getPixels();
Pixel pixel = null;
//Loop through all pixels in the picture
for (int i=0; i<pixelArray.length;i++){
pixel = pixelArray[i];

int blueV = pixel.getBlue();
if(blueV<128)
{
pixel.setBlue(0);
}
else
{
pixel.setBlue(255);
}
//Set the color to the negative of current color
}
}

/****************************
Crop picture
*****************************/
public void copyPictureTo(Picture sourcePicture, int startX, int startY,
int endX, int endY, int targetStartX, int targetStartY)
{
Pixel sourcePixel = null;
Pixel targetPixel = null;
// loop through the x values
for (int x = startX, tx = targetStartX; x < endX && x < sourcePicture.getWidth() && tx < this.getWidth(); x++, tx++)
{
// loop through the y values
for (int y = startY, ty = targetStartY; y < endY && y < sourcePicture.getHeight() && ty < this.getHeight(); y++, ty++)
{

// copy the source color to the target color
sourcePixel = sourcePicture.getPixel(x,y);
targetPixel = this.getPixel(tx,ty);
targetPixel.setColor(sourcePixel.getColor());
}
}
}

/*****************************************************************
* Method to make a negative of a picture
*****************************************************************/
public void negate(){
//Local variables
Pixel[] pixelArray = this.getPixels();
Pixel pixel = null;
int redV, blueV, greenV = 0;
//Loop through all pixels in the picture
for (int i=0; i<pixelArray.length;i++){
pixel = pixelArray[i];
redV=pixel.getRed();
greenV=pixel.getGreen();
blueV = pixel.getBlue();
//Set the color to the negative of current color
pixel.setColor(new Color(255-redV, 255-greenV, 255-blueV));
}
}


/*****************************************************************
* Method to create a fake sunset
*****************************************************************/
public void makeSunset(){
//Create local variables and get array of pixels
Pixel[] pixelArray = this.getPixels();
Pixel pixel = null;
int value = 0;
int i=0;

//Loop through all pixels
while (i<pixelArray.length){
pixel = pixelArray[i]; //get out current picture
value = pixel.getBlue(); //get the blue value
pixel.setBlue((int)(value*0.7)); //set a new blue
value = pixel.getGreen(); //get the green value
pixel.setGreen((int)(value*0.7)); //set the new green value
i++; //increment counter
}
}


/*****************************************************************
* Method to decrease the red in a picture
*****************************************************************/
public void decreaseRed(){
//Declare variables and get an array with all the pixels
Pixel[] pixelArray = this.getPixels();
Pixel pixel = null;
int value = 0;
int index = 0;
//Loop through all pixels
while (index < pixelArray.length){
pixel = pixelArray[index]; //get pixel at each spot in the array in turn
value = pixel.getRed(); //get the red value
value=(int)(value*0.5); //change the red value by half
pixel.setRed(value); //set a new red value
index= index + 1; //increment so next time you get new pixel
}
}


} // end of class Picture, put all new methods before this

Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Mar 18 2014 07:36pm
Quote
You will make use of the FrameSequencer and MoviePlayer classes provided with our textbook in order to create and display a movie.


I would need these two classes to help.
Member
Posts: 2,458
Joined: Sep 20 2009
Gold: 10,110.50
Mar 18 2014 07:38pm
Quote (Minkomonster @ Mar 18 2014 09:36pm)
I would need these two classes to help.

Framesequencer
Code
import java.util.*;
import java.text.*;
import java.io.*;

/**
* Class to save frames in a movie to a directory. This class
* tracks the directory, base file name, current frame number,
* and whether this sequence is being shown.
*
* Copyright Georgia Institute of Technology 2004
* @author Barbara Ericson
*/
public class FrameSequence
{
//////////////////// Fields ///////////////////////////////////

/** stores the directory to write the frames to */
private String directory;

/** stores the base file name for each frame file */
private String baseName = "frame";

/** stores the current frame number */
private int frameNumber = 1;

/** true if this sequence is being shown */
private boolean shown = false;

/** the picture frame used to show this sequence */
private PictureFrame pictureFrame = null;

/** List of all the pictures so far */
private List pictureList = new ArrayList();

/** Use this to format the number for the frame */
private NumberFormat numberFormat = NumberFormat.getIntegerInstance();

//////////////////// Constructors /////////////////////////////

/**
* Constructor that takes a directory name
* @param directory the directory to save the frames to
*/
public FrameSequence(String directory)
{
this.directory = directory;
initFormatter();
validateDirectory();
}

/**
* Constructor that takes a directory name and a base file name
* @param directory the directory to save the frames to
* @param baseName the base file name to use for the frames
*/
public FrameSequence(String directory, String baseName)
{
// use the other constructor to set the directory
this(directory);

// set the base file name
this.baseName = baseName;
}


///////////////////// Methods ////////////////////////////////

/**
* Method to get the directory to write the frames to
* @return the directory to write the frames to
*/
public String getDirectory() { return directory; }

/**
* Method to set the directory to write the frames to
* @param dir the directory to use
*/
public void setDirectory(String dir) { directory = dir; }

/**
* Method to get the base name
* @return the base file name for the movie frames
*/
public String getBaseName() { return baseName; }

/**
* Method to set the base name
* @param name the new base name to use
*/
public void setBaseName(String name) { baseName = name; }

/**
* Method to get the frame number
* @return the next frame number for the next picture
* added
*/
public int getFrameNumber() { return frameNumber; }

/**
* Method to check if the frame sequence is being shown
* @return true if shown and false otherwise
*/
public boolean isShown() { return shown; }

/**
* Method to set the shown flag
* @param value the value to use
*/
public void setShown(boolean value) { shown = value; }

/**
* Method to get the number of frames in this sequence
* @return the number of frames
*/
public int getNumFrames() { return pictureList.size(); }

/**
* Method to set the picture frame to use to shown this
* @param frame the picture frame to use
*/
public void setPictureFrame(PictureFrame frame) { pictureFrame = frame; }

/**
* Method to get the picture frame to use to show this sequence
* @return the picture frame used to show this (may be null)
*/
public PictureFrame getPictureFrame() { return pictureFrame; }

/**
* Method to initialize the number formatter to show 4 digits
* with no commas
*/
private void initFormatter()
{
numberFormat.setMinimumIntegerDigits(4);
numberFormat.setGroupingUsed(false);
}

/**
* Method to validate the directory (make
* sure it ends with a separator character
*/
private void validateDirectory()
{
char end = directory.charAt(directory.length() - 1);
if (end != '/' || end != '\\')
directory = directory + '/';
File directoryFile = new File(directory);
if (!directoryFile.exists())
directoryFile.mkdirs();
}

/**
* Method to add a picture to the frame sequence
* @param picture the picture to add
*/
public void addFrame(Picture picture)
{

// add this picture to the list
pictureList.add(picture);

// write out this frame
picture.write(directory + baseName +
numberFormat.format(frameNumber) + ".jpg");

// if this sequence is being shown update the frame
if (shown)
{
if (pictureFrame != null)
pictureFrame.setPicture(picture);
else
pictureFrame = new PictureFrame(picture);
}

// increment the frame number
frameNumber++;
}

/**
* Method to show the frame sequence
*/
public void show()
{
if (shown != true)
{
// set it to true
shown = true;

// if there is a picture show the last one
if (pictureList.size() > 0)
pictureFrame = new PictureFrame((Picture) pictureList.get(pictureList.size() - 1));
else
System.out.println("There are no frames to show yet. When you add a frame it will be shown");
}
}

/**
* Method to replay the frames (pictures) added so far
* @param sleepTime the amount to sleep in milliseconds
* between frames
*/
public void replay(int sleepTime)
{
Picture picture = null;
Iterator iterator = pictureList.iterator();
while (iterator.hasNext())
{
picture = (Picture) iterator.next();
pictureFrame.setPicture(picture);
try {
Thread.sleep(sleepTime);
} catch (Exception ex) {
}
}
}

} // end of class


This post was edited by Elitist on Mar 18 2014 07:39pm
Member
Posts: 2,458
Joined: Sep 20 2009
Gold: 10,110.50
Mar 18 2014 07:40pm
And moviePlayer

Code
import javax.swing.*;
import java.util.*;
import java.io.*;
import java.awt.Container;
import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.event.*;

/**
* Class that can play movies from multiple frames
* @author Barb Ericson
*/
public class MoviePlayer
{

///////////////// fields ///////////////////////////

private JFrame frame = new JFrame("Movie Player");
private JLabel frameLabel = new JLabel("No images yet!");
private AnimationPanel animationPanel = null;

//////////////////// constructors ////////////////////

/**
* Constructor that takes a list of pictures
* @param pictureList the list of pictures to show
*/
public MoviePlayer(List pictureList)
{
animationPanel = new AnimationPanel(pictureList);
init();
}

/**
* Constructor that takes a directory and shows a movie
* from it
* @param directory the directory with the frames
*/
public MoviePlayer(String directory)
{
animationPanel = new AnimationPanel(directory);
init();
}

/////////////////////// methods ////////////////////////////

/**
* Method to show the next image
*/
public void showNext()
{
animationPanel.showNext();
frameLabel.setText("Frame Number " +
animationPanel.getCurrIndex());
frame.repaint();
}

/**
* Method to show the previous image
*/
public void showPrevious()
{
animationPanel.showPrev();
frameLabel.setText("Frame Number " +
animationPanel.getCurrIndex());
frame.repaint();
}

/**
* Method to play the movie from the beginning
*/
public void playMovie()
{
frameLabel.setText("Playing Movie");
frame.repaint();
animationPanel.showAll();
frameLabel.setText("Frame Number " +
animationPanel.getCurrIndex());
frame.repaint();
}

/**
* Method to play the movie from the beginning
* @param framesPerSecond the number of frames to show
* per second
*/
public void playMovie(int framesPerSecond)
{
animationPanel.setFramesPerSec(framesPerSecond);
playMovie();
}

/**
* Method to add a picture to the movie
* @param picture the picture to add
*/
public void addPicture(Picture picture)
{
animationPanel.add(picture);
showNext();
}

/**
* Method to set up the gui
*/
private void init()
{
Container container = frame.getContentPane();
container.setLayout(new BorderLayout());
JPanel buttonPanel = new JPanel();

// add the animation panel
container.add(animationPanel,BorderLayout.CENTER);

// add the frame label to the north
JPanel labelPanel = new JPanel();
labelPanel.add(frameLabel);
container.add(labelPanel,BorderLayout.NORTH);

// add the button panel to the south
container.add(new ButtonPanel(this),BorderLayout.SOUTH);

// set the size of the frame
frame.pack();

// show the frame
frame.setVisible(true);
}

/**
* Method to set the visibility of the frame
* @param flag the visibility of the frame
*/
public void setVisible(boolean flag)
{
frame.setVisible(flag);
}

public static void main(String[] args)
{
MoviePlayer moviePlayer =
new MoviePlayer("c:/intro-prog-java/mediasources/fish/");
moviePlayer.playMovie(16);
}

}
Member
Posts: 2,458
Joined: Sep 20 2009
Gold: 10,110.50
Mar 18 2014 07:48pm
forgot to include the last bit of instructions;

3. Frames will be determined by numStages input by user.
4. When creating the reversal of the fade, don’t recreate all the intermediate images in the reverse order. You can just add the images from the picture array “backwards” into the FrameSequencer.
5. You can select two of the images from the following sets of pictures that are the same size:
{flower1.jpg, flower2.jpg}, {whiteFlower.jpg, yellowFlowers.jpg, rose.jpg}, {swan.jpg, twoSwans.jpg}, or you can use your own pictures that are the same size.

Caution: If you use your own pictures, you may run out of memory space if they are too large. Try your program on small pictures first, such as those suggested for Part A.

This post was edited by Elitist on Mar 18 2014 07:48pm
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Mar 18 2014 08:12pm
Seems pretty straight forward, again

Create your FrameSequence, and your MoviePlayer;

Grab the startPicture and endPicture

Then create a Picture[], instantiate each index with a new picture;

do something like

Code
Picture startPicture = FilePicker.getStartPicture();
Picture endPicture = FilePicker.getEndPicture();

Picture[] movie = new Picture[24]; //24 frames

for(int i = 0; i < movie.length/2; i++)
picture[i].fadeOut(startPicture, Color.BLACK,movie.length/2,i);

for(int i = 0; i < (movie.length/2)-1; i++)
picture[i]/fadeIn(endPicture, Color.BLACK, movie.length/2, i);

FrameSequence frameSequencer = new FrameSequence(directoryName);

for (int i = 0; i < movie.length; i++)
frameSequencer.addFrame(movie[i]);

MoviePlayer player = new MoviePlayer(directoryName);

player.playMovie();



Not compiled. Literally written right into the post window.
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll