Public Sub SimpleUnroll(Source As PictureBox, Target As PictureBox, Optional TubeWidth = 50)
Dim XTube As Long, Offset As Long, XPicture As Long, RDS As Double
Target.Cls
RDS = 6.283185307 / (TubeWidth * 2)
For Offset = 0 To Source.ScaleWidth - 1
If Offset - TubeWidth >= 0 Then Target.PaintPicture Source.Picture, Offset - TubeWidth, 0, 1, Source.ScaleHeight, Offset - TubeWidth, 0, 1, Source.ScaleHeight
For XTube = 1 To TubeWidth
XPicture = ACos(XTube / (TubeWidth / 2)) / RDS
If Offset + XPicture < Source.ScaleWidth Then
Target.PaintPicture Source.Picture, Offset + XTube - TubeWidth, 0, 1, Source.ScaleHeight, Offset + XPicture, 0, 1, Source.ScaleHeight
Else
Target.PaintPicture Source.Picture, Offset + XTube - TubeWidth, 0, 1, Source.ScaleHeight, Offset + XTube - TubeWidth, 0, 1, Source.ScaleHeight
End If
Next XTube
Next Offset
End Sub