473,396 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 2881
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: byrd48 | last post by:
Hi, I am developing a web site which allows users to upload and share photos. I have a datalist which lists the photos and has the usual edit, update commands. Within the edititemtemplate, I...
0
by: adi sesha | last post by:
Hi i am able to rotate the picture in the picture box to the specific angle in vb.net but i want to rotate the picture CONTROL to the specified angle.Thanks in advance sesha ...
1
by: iwdu15 | last post by:
hi, im trying to rotate a gdi drawn object on my form with a keypress....forinstance when i push the down arrow, for it to rotate the object drawn until the top is down, or if i push the right...
0
by: kumar_ps | last post by:
i am using vb6.0. In my application i have taken a picturebox and menu. In the menu i have taken file. in the file menu i have taken open command when i click a open command it will show a dialogbox...
2
by: kumar_ps | last post by:
Hi, I am new for VB6.0 i need help urgent.. I have taken a picture box and a dialogbox for open when i click open dialog is showing bu how to open pdf files in the picturebox. and suppose we open a...
8
by: lovecreatesbeauty | last post by:
I write a function to rotate a matrix by 90 degrees clockwise, this function works on a matrix of specific size, for example, it rotates a 4*4 matrix of integers in the following code. The function...
3
by: Diego F. | last post by:
Hi all. I have a listview with images and my application must be able to rotate one image. I need a method to rotate 90 degrees rigth (i.e.). Is that possible? -- Regards, Diego F.
10
by: Joey_Stacks | last post by:
Does anyone know of a scipt that will rotate random div layers on page refresh? I have a primary content area front and center on my site homepage, and I'd like to rotate various chunks of html...
8
by: Syoam4ka | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.