|
-
Apr 19th, 2008, 12:31 AM
#1
Thread Starter
Junior Member
[2008] Drawing and rotating some transparent images
I expected this to be really easy but was sorely disappointed.
My first attempt was PictureBox controls and of course that turned out horribly


Then I realised it didn't support arbitary rotations anyway so I gave up on it.
Then I found out all about painting stuff to forms so I tried that and it was all looking good

Until I rotated Head and found out that everything in the graphic control gets rotatated (even if I separate as shown in the code below)

Code:
Public Class AnimationPlayer
'Arm, top. Front.
Private Sub AnimationPlayer_Paint9(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\arm-t.tif"), 24, 60, 32, 16)
End Sub
'Arm, bottom. Front.
Private Sub AnimationPlayer_Paint8(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\arm-b.tif"), 47, 60, 32, 16)
End Sub
'Head
Private Sub AnimationPlayer_Paint7(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\head.tif"), 0, 0, 64, 64)
End Sub
'Body
Private Sub AnimationPlayer_Paint6(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF/body.tif"), 0, 30, 64, 64)
End Sub
'Leg, top. Rear.
Private Sub AnimationPlayer_Paint5(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\leg-top-rear.tif"), 28, 80, 16, 32)
End Sub
'Leg, bottom. Front.
Private Sub AnimationPlayer_Paint4(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\leg-bottom.tif"), 17, 105, 32, 32)
End Sub
'Leg, top. Front.
Private Sub AnimationPlayer_Paint3(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\leg-top.tif"), 18, 80, 16, 32)
End Sub
'Leg, bottom. Rear.
Private Sub AnimationPlayer_Paint2(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\leg-bottom-rear.tif"), 27, 105, 32, 32)
End Sub
'Arm, top. Rear.
Private Sub AnimationPlayer_Paint1(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\arm-tr.tif"), 25, 60, 32, 16)
End Sub
'Arm, bottom. Rear.
Private Sub AnimationPlayer_Paint(ByVal sender As Object, ByVal Part As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Part.Graphics.DrawImage(Image.FromFile("C:\Documents and Settings\Ben\My Documents\Visual Studio 2005\Projects\FacewoundLauncher\Animation Editor\Animation Editor\Resources\TIFF\arm-br.tif"), 48, 60, 32, 16)
End Sub
End Class
Great.
So I decide to try and make DirectX do it after reading some rather scary looking tutorials. However, DirectX doesn't show up for me as a Referenceable component and if I manually add it with Browse... I end up getting weird errors.
So never mind DirectX, using paint, how can I have multiple layers or specify the object to rotate?
(Or maybe you have an even easier way )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|