I've written a standard resizing library in C# before, it's easy enough to keep the aspect ratio, you just need to know when resizing if you want to:
- Force to dimensions X,Y - Ignore original aspect ratio
- Border X,Y - Maintain aspect ratio but with borders (like black ones on films)
- Cut X,Y - Maintain aspect ratio but cut the outer parts that don't fit
- Keep ratio to x or y - Keep the aspect ratio, scale so it fits either x or y
If you have any specific questions about the dimensions/logic side of things let me know
Simple logic process with a 800:600 original and a 100x60 space:
get original ratio, calculate scale for x and y (so say 4:3 for x and 3:4 for y)
Attempt to fit object in using first x dimension, so you would get a 100x75 image if you kept x so
if image > bounds, revert to y to get a 80:60 image instead if you wanted to force the image to fit in the dimensions,
otherwise fit to x instead of fit absolute

_________________TwitterCharlie Brooker:
Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.