Dim x1, y1, x2, y2 As IntegerPrivate Sub Command1_Click()
    If x1 > x2 Then
        x3 = x1
        x1 = x2
        x2 = x3
    End If
    If y1 > y2 Then
        y3 = y1
        y1 = y2
        y2 = y3
    End If
    Picture2.Picture = LoadPicture
    Picture2.PaintPicture Picture1.Picture, 0, 0, (x2 - x1), (y2 - y1), x1, y1, (x2 - x1), (y2 - y1), vbSrcCopy
    SavePicture Picture2.Image, "d:\1.bmp"
End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    x1 = X
    y1 = Y
End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    x2 = X
    y2 = Y
End Sub