Private m_DogBitmap As Bitmap
Private m_BoneBitmap As Bitmap
Private m_Dragging As Boolean
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
' Save the dog image.
m_DogBitmap = New Bitmap(Me.BackgroundImage)
' Save the bone image.
m_BoneBitmap = picBone.Image
m_BoneBitmap.MakeTransparent(Color.Red)
End Sub
' Display the bone.
Private Sub ShowBone(ByVal X As Integer, ByVal Y As Integer)
Dim gr As Graphics = Me.CreateGraphics()
gr.DrawImageUnscaled(m_DogBitmap, 0, 0)
gr.DrawImageUnscaled(m_BoneBitmap, X, Y)
End Sub
|