URGENT - Rotate a pictureBox

C

Const

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 !
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
F

Frans Bouma [C# MVP]

Const said:
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/archive/2005/12/25/433976.aspx

FB

--
 
W

Willy Denoyette [MVP]

| 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/archive/2005/12/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.
 
F

Frans Bouma [C# MVP]

Willy said:
| > 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 !

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
 
W

Willy Denoyette [MVP]

| Willy Denoyette [MVP] wrote:
|
| >
| > message | > > 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/archive/2005/12/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.
 
F

Frans Bouma [C# MVP]

Willy said:
| >
| > 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());

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


--
 
W

Willy Denoyette [MVP]

| Willy Denoyette [MVP] wrote:
|
| >
| > message | > > 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.
 
F

Frans Bouma [C# MVP]

Willy said:
| >
| > message | > > 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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top