471,605 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

URGENT - Rotate a pictureBox

Hi!

I wonder how to rotate a pictureBox, welle, the image in the pictureBox
!

I watched old post form here, but i can't find any answer for this. I
would like to rotate my pic like a sprite, with any angle possible.

Anyone could help me please ?? I can't imagine there is only a
complicated way to do a such simple thing !

Thanks !

Feb 7 '06 #1
8 2816
Const,

This is something you will have to paint yourself. You should use the
DrawImage method on the Graphics instance to draw an image.

You would also have to set the Transform property to a Matrix instance
which would perform the rotation.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Const" <co*****@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hi!

I wonder how to rotate a pictureBox, welle, the image in the pictureBox
!

I watched old post form here, but i can't find any answer for this. I
would like to rotate my pic like a sprite, with any angle possible.

Anyone could help me please ?? I can't imagine there is only a
complicated way to do a such simple thing !

Thanks !

Feb 7 '06 #2
Const wrote:
Hi!

I wonder how to rotate a pictureBox, welle, the image in the
pictureBox !

I watched old post form here, but i can't find any answer for this. I
would like to rotate my pic like a sprite, with any angle possible.

Anyone could help me please ?? I can't imagine there is only a
complicated way to do a such simple thing !

Thanks !


See the render code inside the following example:

http://weblogs.asp.net/fbouma/archiv...25/433976.aspx

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 7 '06 #3

"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in message
news:xn***************@news.microsoft.com...
| Const wrote:
|
| > Hi!
| >
| > I wonder how to rotate a pictureBox, welle, the image in the
| > pictureBox !
| >
| > I watched old post form here, but i can't find any answer for this. I
| > would like to rotate my pic like a sprite, with any angle possible.
| >
| > Anyone could help me please ?? I can't imagine there is only a
| > complicated way to do a such simple thing !
| >
| > Thanks !
|
| See the render code inside the following example:
|
| http://weblogs.asp.net/fbouma/archiv...25/433976.aspx
|
| FB
|
| --
| ------------------------------------------------------------------------
| Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
| My .NET blog: http://weblogs.asp.net/fbouma
| Microsoft MVP (C#)
| ------------------------------------------------------------------------

As the comments on this entry are closed I post them here.

You can get accurate results for the frames per second counter value when
you calculate _timeCurrentFrame in the Animate method like this:
_timeCurrentFrame = new
DateTime(System.Diagnostics.Stopwatch.GetTimestamp ());

Willy.



Feb 7 '06 #4
Willy Denoyette [MVP] wrote:

"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in
message news:xn***************@news.microsoft.com...
Const wrote:

| > Hi!
| >
| > I wonder how to rotate a pictureBox, welle, the image in the
| > pictureBox !
| >
| > I watched old post form here, but i can't find any answer for
this. I | > would like to rotate my pic like a sprite, with any angle
possible. | >
| > Anyone could help me please ?? I can't imagine there is only a
| > complicated way to do a such simple thing !
| >
| > Thanks !

See the render code inside the following example:

http://weblogs.asp.net/fbouma/archiv...25/433976.aspx

----


As the comments on this entry are closed I post them here.

You can get accurate results for the frames per second counter value
when you calculate _timeCurrentFrame in the Animate method like this:
_timeCurrentFrame = new
DateTime(System.Diagnostics.Stopwatch.GetTimestamp ());


Thanks Willy! I'll check it out :) I didn't think of the system ticker
counter for this which is indeed more accurate :)

FB
Feb 8 '06 #5

"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in message
news:xn***************@news.microsoft.com...
| Willy Denoyette [MVP] wrote:
|
| >
| > "Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in
| > message news:xn***************@news.microsoft.com...
| > > Const wrote:
| > >
| > | > Hi!
| > | >
| > | > I wonder how to rotate a pictureBox, welle, the image in the
| > | > pictureBox !
| > | >
| > | > I watched old post form here, but i can't find any answer for
| > this. I | > would like to rotate my pic like a sprite, with any angle
| > possible. | >
| > | > Anyone could help me please ?? I can't imagine there is only a
| > | > complicated way to do a such simple thing !
| > | >
| > | > Thanks !
| > >
| > > See the render code inside the following example:
| > >
| > > http://weblogs.asp.net/fbouma/archiv...25/433976.aspx
| > >
| > > ----
| >
| > As the comments on this entry are closed I post them here.
| >
| > You can get accurate results for the frames per second counter value
| > when you calculate _timeCurrentFrame in the Animate method like this:
| > _timeCurrentFrame = new
| > DateTime(System.Diagnostics.Stopwatch.GetTimestamp ());
|
| Thanks Willy! I'll check it out :) I didn't think of the system ticker
| counter for this which is indeed more accurate :)
|
| FB

Well, no big deal, I was affraid you were going to "de computerboer om de
hoek" to buy some watercooled NVIDIA graphics board ;-) to increase your
frame rate.

Willy.
Feb 8 '06 #6
Willy Denoyette [MVP] wrote:

"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in
message news:xn***************@news.microsoft.com...
Willy Denoyette [MVP] wrote:

| >
| > You can get accurate results for the frames per second counter
value | > when you calculate _timeCurrentFrame in the Animate method
like this: | > _timeCurrentFrame = new
| > DateTime(System.Diagnostics.Stopwatch.GetTimestamp ());

Thanks Willy! I'll check it out :) I didn't think of the system
ticker counter for this which is indeed more accurate :)

FB


Well, no big deal, I was affraid you were going to "de computerboer
om de hoek" to buy some watercooled NVIDIA graphics board ;-) to
increase your frame rate.


Naah ;) software rendering doesn't need fancy graphic boards ;) I knew
about that timer, I used it in my opengl stuff back in the early days,
but I completely forgot to use it in .net code. The abstraction of .NET
sometimes makes you forget that the OS has wonderful stuff to offer as
well (or in this case, the system hw!).

FB
--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 9 '06 #7

"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in message
news:xn***************@news.microsoft.com...
| Willy Denoyette [MVP] wrote:
|
| >
| > "Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in
| > message news:xn***************@news.microsoft.com...
| > > Willy Denoyette [MVP] wrote:
| > | >
| > | > You can get accurate results for the frames per second counter
| > value | > when you calculate _timeCurrentFrame in the Animate method
| > like this: | > _timeCurrentFrame = new
| > | > DateTime(System.Diagnostics.Stopwatch.GetTimestamp ());
| > >
| > > Thanks Willy! I'll check it out :) I didn't think of the system
| > > ticker counter for this which is indeed more accurate :)
| > >
| > > FB
| >
| > Well, no big deal, I was affraid you were going to "de computerboer
| > om de hoek" to buy some watercooled NVIDIA graphics board ;-) to
| > increase your frame rate.
|
| Naah ;) software rendering doesn't need fancy graphic boards ;)

True, I was just kidding.
Bet that "de computerboer" would tell you a different story ;-).

Willy.

Feb 9 '06 #8
Willy Denoyette [MVP] wrote:

"Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in
message news:xn***************@news.microsoft.com...
Willy Denoyette [MVP] wrote:

| >
| > "Frans Bouma [C# MVP]" <pe******************@xs4all.nl> wrote in
| > message news:xn***************@news.microsoft.com...
| > > Willy Denoyette [MVP] wrote:
| > | >
| > | > You can get accurate results for the frames per second counter
| > value | > when you calculate _timeCurrentFrame in the Animate
method | > like this: | > _timeCurrentFrame = new
| > | > DateTime(System.Diagnostics.Stopwatch.GetTimestamp ());
| > >
| > > Thanks Willy! I'll check it out :) I didn't think of the system
| > > ticker counter for this which is indeed more accurate :)
| > >
| > > FB
| >
| > Well, no big deal, I was affraid you were going to "de
computerboer | > om de hoek" to buy some watercooled NVIDIA graphics
board ;-) to | > increase your frame rate.

Naah ;) software rendering doesn't need fancy graphic boards ;)


True, I was just kidding.
Bet that "de computerboer" would tell you a different story ;-).


hehe well I think you're right, the computerboer here right around the
corner will even sell his mother ;)

FB
Feb 10 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by byrd48 | last post: by
reply views Thread by adi sesha | last post: by
1 post views Thread by iwdu15 | last post: by
8 posts views Thread by lovecreatesbeauty | last post: by
3 posts views Thread by Diego F. | last post: by
10 posts views Thread by Joey_Stacks | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.