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 ) ;
}
```
You might also like to view...
A(n) ____________, or GUI, allows the user to interact with the operating system and application programs through graphical elements on the screen.
a. general-purpose interface b. graphical user interface c. generic unified interface d. graphics utility interface
In the binary search, each pass (recursion or iteration) selects a subproblem of the original problem to solve. What fraction of the array sent to an initial call is eliminated in the next iterative pass or recursive call?
What will be an ideal response?
Explain how to review a document for spelling and grammar
What will be an ideal response?
What happens when you assign one array to another using the assignment operator?
A. An error message is generated. B. Elements are copied to new memory locations. C. Both arrays become value type data elements. D. Both arrays reference the same memory locations.