Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,148 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,069 people online right now. Registration is fast and FREE... Join Now!




Image Rotation in GDI+

 
Reply to this topicStart new topic

Image Rotation in GDI+, Image Rotation using Win32/GDI+

Lamefif
5 Jun, 2007 - 07:00 AM
Post #1

New D.I.C Head
*

Joined: 24 Apr, 2007
Posts: 9


My Contributions
gr.RotateTransform(45);
gr.DrawImage(&img,0,0);

that will rotate an image round the window corner, how can i rotate it through the image center instead, or make it look as if it is.

ty
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Image Rotation In GDI+
6 Jun, 2007 - 07:08 PM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
I was really hoping that some GDI+ guru would step up and talk about coordinate transforms. I believe that you will have to translate the coordinate system, OR not place it at (0,0)... So if you place the image at (-ImageWidth/2, -ImageHeight/2) that should be right, or you can translate the coordinate system by half the Image height and width.

Hopefully someone who knows a bit more about GDI+ can tell us if I am right. (else you have to wait until I have time to play with it and see).
User is offlineProfile CardPM
+Quote Post

Lamefif
RE: Image Rotation In GDI+
7 Jun, 2007 - 05:41 AM
Post #3

New D.I.C Head
*

Joined: 24 Apr, 2007
Posts: 9


My Contributions
QUOTE(NickDMax @ 6 Jun, 2007 - 08:08 PM) *

I was really hoping that some GDI+ guru would step up and talk about coordinate transforms. I believe that you will have to translate the coordinate system, OR not place it at (0,0)... So if you place the image at (-ImageWidth/2, -ImageHeight/2) that should be right, or you can translate the coordinate system by half the Image height and width.

Hopefully someone who knows a bit more about GDI+ can tell us if I am right. (else you have to wait until I have time to play with it and see).


waiting.........IPB Image
then what, how do you move the image to where you want it.

gr.RotateTransform(45); this looks like is rotating the hdc .



thanks

This post has been edited by Lamefif: 7 Jun, 2007 - 05:43 AM
User is offlineProfile CardPM
+Quote Post

Lamefif
RE: Image Rotation In GDI+
7 Jun, 2007 - 12:45 PM
Post #4

New D.I.C Head
*

Joined: 24 Apr, 2007
Posts: 9


My Contributions
some enlightenment at the bottom of this page:

http://www.leunen.com/cbuilder/rotbmp.html

for anyone looking crazy.gif
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Image Rotation In GDI+
7 Jun, 2007 - 09:34 PM
Post #5

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
thank you for the link. I have been meaning to get into GDI+ for a while now.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:55PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month