VB Code:
Option Explicit
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
Private Sub Picture1_Click()
Randomize Timer
Dim NewX As Long, NewY As Long
NewX = Int(Rnd * Form1.ScaleWidth)
NewY = Int(Rnd * Form1.ScaleHeight)
BitBlt Form1.hDC, NewX, NewY, Picture1.Width, Picture1.Height, Picture1.hDC, 0, 0, SRCCOPY
End Sub