Private Function Laser(picBild As PictureBox, StartX As Integer, StartY As Integer, StandLeft As Integer, StandRight As Integer, sFarbe As String)

Dim iZahl, iZahl2 As Integer
Dim sFarbe2 As String

Me.ScaleMode = vbPixels

With picBild
.ScaleMode = vbPixels
.AutoRedraw = True
End With

For iZahl2 = 0 To picBild.ScaleWidth
For iZahl = 0 To picBild.ScaleHeight
sFarbe2 = picBild.Point(iZahl2, iZahl)
Line (StartX, StartY)-(StandLeft + iZahl2, StandRight + iZahl), sFarbe2
Next
Line (StartX, StartY)-(StandLeft + iZahl2, StandRight + picBild.ScaleHeight), sFarbe
Next

For iZahl2 = 0 To picBild.ScaleHeight
Line (StartX, StartY)-(StandLeft + picBild.ScaleWidth, StandRight + iZahl2), sFarbe
Next

End Function


Private Sub Command1_Click()

Laser Picture1, 300, 300, 10, 10, Me.BackColor

End Sub
