Create a movie that has a JPEG image rotating in it.
What will be an ideal response?
```
/**
* Method to c r e a t e a r o t a t i n g image movie
* @param p the p i c t u r e to r o t a t e
* @param d i r e c t o r y the d i r e c t o r y to s t o r e the frames in
*/
public void makeRotatingMovie ( Pi c tur e p , St r ing d i r e c t o r y )
{
// make a copy of the p i c t u r e
Pi c tur e tempPict = nul l ;
int max = Math .max(p . getWidth ( ) , p . ge tHe ight ( ) ) ;
Pi c tur e copyPict = nul l ;
// d e c l a r e o the r v a r i a b l e s
FrameSequencer f rameSequencer =
new FrameSequencer ( d i r e c t o r y ) ;
int f ramesPerSec = 3 0 ;
// loop c r e a t i n g the frames
for ( int i = 0 ; i < f ramesPerSec ; i++)
tempPict = new Pi c tur e (p ) ;
tempPict = tempPict . r o t a t e ( i * 5 ) ;
copyPict = new Pi c tur e (max ,max ) ;
copyPict . copy ( tempPict , 0 , 0 ) ;
f rameSequencer . addFrame ( copyPict ) ;
}
// p lay the movie
f rameSequencer . play ( f ramesPerSec ) ;
}
```
You might also like to view...
Multithreading is important because it can ________.
a) facilitate software design and promote good programming practices b) improve performance and scalability c) facilitate cooperation/synchronization of activities d) all of the above
A(n) ________ samples the analog voltage many times each second and assigns a binary number to the voltage at each point in time
Fill in the blank(s) with correct word
Word wrap occurs automatically if a word does not fit on a line
Indicate whether the statement is true or false.
JCA provides by default a concrete implementation of the java.security package.
Answer the following statement true (T) or false (F)