Create a movie that has a JPEG image rotating in it.

What will be an ideal response?

```
/? ?
? Method t o c r e a t e a r o t a t i n g image movie
? @param p t h e p i c t u r e t o r o t a t e
? @param d i r e c t o r y t h e d i r e c t o r y t o s t o r e t h e frame s i n
?/
public void makeRotatingMovie ( P i c t u r e p , S t r i n g d i r e c t o r y )
{
// make a copy o f t h e p i c t u r e
P i c t u r e tempPict = null ;
i n t max = Math . max( p . getWidth ( ) , p . g e t H e i g h t ( ) ) ;
P i c t u r e c o p y P i c t = null ;
// d e c l a r e o t h e r v a r i a b l e s
FrameSequencer f r a m e S e q u e n c e r =
new FrameSequencer ( d i r e c t o r y ) ;
int framesPerSec = 3 0 ;
// l o o p c r e a t i n g t h e frames
f o r ( i n t i = 0 ; i < f r a m e s P e r S e c ; i ++)
{
Encoding, Manipulating, and Creating Movies
tempPict = new P i c t u r e ( p ) ;
tempPict = tempPict . r o t a t e ( i ? 5 ) ;
c o p y P i c t = new P i c t u r e (max , max ) ;
c o p y P i c t . copy ( tempPict , 0 , 0 ) ;
f r a m e S e q u e n c e r . addFrame ( c o p y P i c t ) ;
}
// p l a y t h e movie
frameSequencer . play ( framesPerSec ) ;
}
```

Computer Science & Information Technology

You might also like to view...

What are two requirements needed to enable a 4 vCPU virtual machine with Fault Tolerance? (Choose two.)

A. vSphere Enterprise Plus license B. 10 GbE uplink for FT logging network C. vSphere Standard license D. 1 GbE uplink for FT logging network

Computer Science & Information Technology

A short-term interruption in electrical power availability is known as a __________.

A. fault B. brownout C. blackout D. lag

Computer Science & Information Technology