Link to home
Start Free TrialLog in
Avatar of Alec417
Alec417

asked on

How to rotate an image in C++

How would one rotate an image in Visual C++, specify the point around which it is rotated, and as a bonus find out where in the newly rotated image a pixel from the origional image was? (Ex. find out where in the new image the bottom-leftmost pixel from the origional image is.)
Avatar of jhance
jhance

Are you looking to do general purpose rotation or limited?  By limited, I mean orthogonal only perhaps.  If so, there are many shortcuts that speed things up by avoiding solving trigonometric (i.e. VERY slow) equations for each point.  If general purpose, you just perform a angular transformation on each point using the origin of the rotation as the base point.  Surely you covered this in grade-school mathematics....

BTW, this wouldn't be homework, would it???
ASKER CERTIFIED SOLUTION
Avatar of viktornet
viktornet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial