Visual basic code for rotating shape

D

Thread Starter

didi

i need to make a "shape" for example a rectangle, on my vb screen to spin or rotate. please can anybody help me?
i need this for my SCADA interface that i am doing using vb. thank you.
 
you can try with array object (with timer) or you can use PictureClip.

If you are good in Flash, try to make a Flash Animation and put on your VB. (you must give a script first).

i hope that will help you.
 
<pre>
Private Sub Form_Load()
Set m = DAControl.PixelLibrary
'define a green oval
Set fillImg = m.SolidColorImage(m.Green)
Set ovalImg = m.Oval(200, 200).Fill(m.DefaultLineStyle, fillImg)
'rotation by 45 degrees per sec around 3D first diagonal
Set rotXf = m.Rotate3RateDegrees(m.Vector3(1, 1, 1), 45).ParallelTransform2()
'apply rotation to oval
Set finalImg = ovalImg.Transform(rotXf)
' set the rotating oval, an image, as the model to be displayed
DAControl.Image = finalImg
'set the background
DAControl.BackgroundImage = m.SolidColorImage(m.Silver)
'start the animation
DAControl.Start
End Sub </pre>
 
J

Joe Jansen/ENGR/HQ/KEMET/US

Note that for this to work, you need to add the DirectAnimation component to your project. Then draw either the DAViewerControl or DAViewerWindowedControl, depending on which you want. Finally, rename the new DAViewewControl to DAControl. After doing that, paste the code below into your Form_Load sub and it will work!

--Joe Jansen
 
Top