Modify Program 29 in this chapter to take the source picture to rotate and to create a new picture of just the needed size. Return the new picture.
What will be an ideal response?
```
public P i c t u r e r o t a t e L e f t ( )
{
P i c t u r e t a r g e t = new P i c t u r e ( t h i s . g e t H e i g h t ( ) ,
t h i s . getWidth ( ) ) ;
P i x e l s o u r c e P i x e l = n u l l ; P i x e l t a r g e t P i x e l = n u l l ;
// l o o p t h r o u g h t h e columns
f o r ( i n t so urc e X = 0 ;
so urc e X < t h i s . getWidth ( ) ; so urc e X++)
{
// l o o p t h r o u g h t h e rows
f o r ( i n t so urc e Y = 0 ;
so urc e Y < t h i s . g e t H e i g h t ( ) ; so urc e Y++)
{
// s e t t h e t a r g e t p i x e l c o l o r t o t h e s o u r c e p i x e l c o l o r s o u r c e P i x e l = t h i s . g e t P i x e l ( sourceX , so urc e Y ) ; t a r g e t P i x e l = t a r g e t . g e t P i x e l ( sourceY ,
t h i s . getWidth ( ) ? 1 ? so urc e X ) ; t a r g e t P i x e l . s e t C o l o r ( s o u r c e P i x e l . g e t C o l o r ( ) ) ;
}
}
return t a r g e t ;
}
```
You might also like to view...
When you launch Facebook's iPhone app, it automatically displays the ________ screen
A) Profile B) Chat C) Timeline D) News Feed
Which of the following is an older VPN protocol based on point-to-point protocol?
a. PPTP b. PPP c. L2TP d. IPSec
____ is a GUI design tool that allows the developer to create a user interface visually without having to spend a lot of time trying to position all the controls within the interface.
A. Scene Builder B. JavaFX C. CSS D. Swing
In a true object-oriented language all programs would have to adhere to an object-oriented structure.
Answer the following statement true (T) or false (F)