you could also look at the Crop and Zoom project...

Theres plenty on code there to help ..

Gremmy...