Wait! You want us to write your code? Show us the money!
What you want to do is create a graphics context of the size you want, draw the image into that at the correct size then extract the image from it. There are functions in the SDK for all of this. Go read the documentation.