469,646 Members | 1,567 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

Please help - how to rotate a picture in picturebox

Hi, I have a WinApp in which I have a pictureBox.

I can draw in it like in the paint of windows - I accomplish that with an arrayList of Points and DrawLines method of the Graphics.

So it really paints like in the Paint of windows.
When I let the mouse left button up it stops drawing of course.

Now I want to rotate that paint (which is actually drawn lines isn't it)?

I have a button - btnRotateToLeft and another button - btnRotateToRight.

All what I want to do is to rotate the pic 90 deg for the left/for the right just like in the AdobePhotoShop or any ImageEditor... Nothing more - just that.

But I want it to be done not by saving the drawnlines to a file first and then reloading it with a bitmap to the pictureBox1.Image using the RotateFlip method - I don't want to save it to a file first - but to rotate it at once.

I am pretty new to the graphic part of c# but I do think that the solution should be with creating new points according to the rotation - or just change the position of the existing points in the arrayList.

The problem is I don't know what's the condition for the new position of the new points. They should be surrounding a center point right?

But how to translate all that logic to the code?


Please help me with that - it's an important task in my job.

Please write a code sample for doing that or at least tell me the way or the tools to use. I think it should be with a Matrix but I don't know how to use it at all. Or maybe a 2-demension array? for the points - x,y?

I don't know.

Please help me.


Thank you:)
Jul 21 '08 #1
8 1687
This Site may be helpful for you..http://www.bobpowell.net/animation.htm
Jul 22 '08 #2
This Site may be helpful for you..http://www.bobpowell.net/animation.htm
Thanks for the link but I don't really understand how to accomplish what I said in my first post - the rotation.

Can anyone write a code sample please or give a link directly to making rotation to the drawn lines in the pictureBox?


Thanks
Jul 22 '08 #3
Anyone pleaseeee!! It's urgent!!

Thanks.
Jul 22 '08 #4
Hi, I have a WinApp in which I have a pictureBox.

I can draw in it like in the paint of windows - I accomplish that with an arrayList of Points and DrawLines method of the Graphics.

So it really paints like in the Paint of windows.
When I let the mouse left button up it stops drawing of course.

Now I want to rotate that paint (which is actually drawn lines isn't it)?

I have a button - btnRotateToLeft and another button - btnRotateToRight.

All what I want to do is to rotate the pic 90 deg for the left/for the right just like in the AdobePhotoShop or any ImageEditor... Nothing more - just that.

But I want it to be done not by saving the drawnlines to a file first and then reloading it with a bitmap to the pictureBox1.Image using the RotateFlip method - I don't want to save it to a file first - but to rotate it at once.

I am pretty new to the graphic part of c# but I do think that the solution should be with creating new points according to the rotation - or just change the position of the existing points in the arrayList.

The problem is I don't know what's the condition for the new position of the new points. They should be surrounding a center point right?

But how to translate all that logic to the code?


Please help me with that - it's an important task in my job.

Please write a code sample for doing that or at least tell me the way or the tools to use. I think it should be with a Matrix but I don't know how to use it at all. Or maybe a 2-demension array? for the points - x,y?

I don't know.

Please help me.


Thank you:)
Jul 23 '08 #5
Curtis Rutland
3,256 Expert 2GB
Do not double post your questions. It makes it very hard for people to answer you especially if there are answers happening in all the threads you have started because they have to read 2 or more threads in order to see what has already been said. It also swamps the forum with your problem resulting in less attention for the other threads

If you feel that your thread is going unnoticed, after a sufficient time (usually 24 hrs) you should reply to your own thread. This will "bump" it back to the top. No need too create identical threads.

Please read the Posting Guidelines

I have merged your threads.

MODERATOR
Jul 23 '08 #6
Ok.

Anyone knows how to accomplish that? please...
Jul 24 '08 #7
tlhintoq
3,525 Expert 2GB
The project sounds like practicing to learn. Your double posting and 'urgent' need sounds like this is homework to be turned in to your teacher very soon. The posting guidelines indicate this is not a forum for having your homework done for you.

I suggest you show the code you have already written for accomplishing your goal and let someone guide you to where you have made mistakes, but asking people to "write the code for me and post it so I can download it" show a lack of inititive on your part.
Jul 25 '08 #8
The project sounds like practicing to learn. Your double posting and 'urgent' need sounds like this is homework to be turned in to your teacher very soon. The posting guidelines indicate this is not a forum for having your homework done for you.

I suggest you show the code you have already written for accomplishing your goal and let someone guide you to where you have made mistakes, but asking people to "write the code for me and post it so I can download it" show a lack of inititive on your part.
Look dude, you may save your assumptions for yourself alright?
Thank you for you help really.....


I have just graduated high school, I have been working in the asp.net domain,
but now if I want to continue working I have to move to the winforms domain (in the same company...). In asp.net I'm pretty fine, but in winforms I don't know almost anything concerning the GUI. That's why I ask code - learning it takes too much time which I don't have, but when I have code and I see what is used there I have a direction what to learn, otherwise I'll learn things which I may not use in my work perhaps...

I don't have a teacher and it isn't homework... ha ,.... homework.. If it was homework I would ask my teacher to help me you know...

Ever mind I guess I will have to overcome it alone...

Thank you very much.
Jul 25 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Chris Coho, Jr. | last post: by
3 posts views Thread by Diego F. | last post: by
1 post views Thread by Macias | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.