Image Rotation Correction

I am using the following to rotate an image:

RadianDegree = RotationDegree * (0.0174533)

NewX = CenterOfImage + (OriginalX - CenterOfImage) * Cosine(RadianDegree) - (OriginalY - CenterOfImage) * Sine(RadianDegree)
NewY = CenterOfImage + (OriginalX - CenterOfImage) * Sine(RadianDegree) + (OriginalY - CenterOfImage) * Cosine(RadianDegree)


Now, it works, but there are holes in the new image. I would like to somehow get rid of the holes, how would that be done?
LVL 8
List244Asked:
Who is Participating?
 
lherrouCommented:
Your question might be better answered in the C++ TA. You can either post in the Community Support TA (click on Support in the upper right of each page, and post a question including the URL of this question, asking it be moved) or post a pointer question in the C++ TA (Go to the C++ TA, create a new question worth 20 points, title it "Pointer to C++ Image Rotation question" and include the URL of this question in the body).

Having said that, have you looked at either of the following as a way to avoid doing this yourself?
http://www.imagemagick.org/Magick++/
http://www.codeproject.com/bitmap/cximage.asp
0
 
bobsanders653Commented:
Beyond me as to the math equation.  I do know that IrfanView at:  http://www.irfanview.com/ can rotate an image quite well and is freeware.  
0
 
lherrouCommented:
What language and toolkit (if any) are you using?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
List244Author Commented:
C++ for math, VB for setting points.
0
 
List244Author Commented:
Actually this is a part of a bigger project, so the images I need rotated are not specific,
but random. So I can not use something else to rotate them.
0
 
lherrouCommented:
Yes, that's why I didn't suggest something like IrfanView, but rather the first link is a C++ API, and the other a C++ class.
0
 
List244Author Commented:
Sorry, the images on the sites through me off, I will take a look later
tonight.
0
 
ozoCommented:
You can rotate an image with with 3 axis parallel shear transforms
see Subject 3.01: How do I rotate a bitmap?
in http://www.faqs.org/faqs/graphics/algorithms-faq/
0
 
List244Author Commented:
A bit busy with school, I will go ahead and close the question and look over it all in a little.
I am sure those source files will be good soon as I can get a look at them, thanks everyone.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.