View Full Version : Rotation of a bitmap image (C++)

10-18-2012, 04:01 AM
I'm new at programming and I need some help with a task assigned for me.
I've been asked to Make a C++ program that can rotate an image q degrees around the point (x,y).

So far I have modified a program a friend of mine made that inputs the bitmap image and outputs a the new image, so that it works for what I want it to do.

I'm having trouble figuring out how to make the algorithm that rotates the image and how to code it. Another problem i'm having is that i'm quite new to programming, I can read and understand code but I have a really hard time just writing code.

Here's what I have made so far:
(The function rotate is the one i'm trying to make)

10-18-2012, 12:01 PM
I've gotten the idea that I could interpret every pixel as a vector and rotate said vector using a 2d rotation matrix, but i'm not sure how I should do so.