Эта версия получше (с проверкой сокета )
SuperStrict
Graphics 1024, 768
AutoMidHandle(True)
Type TStreamFactoryWWW Extends TStreamFactory
Method CreateStream:TStream(url:Object, proto:String, path:String, readable:Int, writeable:Int)
If proto = "www"
Local ping:Int = 100
Local stream:TSocketStream
DeleteFile("temp")
Local temp:TStream = WriteStream("temp")
Repeat
If stream
If stream.Eof() Then Exit
If SocketConnected(stream._socket)
temp.WriteByte(stream.ReadByte())
Continue
EndIf
stream = Null
End If
If ping = 0 Then Return Null
stream = TSocketStream(ReadStream("http::" + path))
If stream Then stream.SkipBytes(temp.Size())
ping:-1
Forever
stream.Close()
temp.Close()
Return OpenStream("temp", readable, writeable)
End If
End Method
End Type
New TStreamFactoryWWW
Local image:TImage = LoadImage("www::www.blitzbasic.com/img/master_of_defence.jpg")
While Not KeyHit(KEY_ESCAPE)
Cls
SetBlend(ALPHABLEND)
SetAlpha(1.0)
SetColor(255, 255, 255)
SetTransform()
DrawImage(image,MouseX(),MouseY(),0)
Flip(1)
Wend
End