Сообщение от MoKa
кеширование с докачкой.. :D
|
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:TStream
DeleteFile("temp")
Local temp:TStream = WriteStream("temp")
Repeat
If stream
If stream.Eof() Then Exit
temp.WriteByte(stream.ReadByte())
Continue
End If
If ping = 0 Then Return Null
stream = 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
Про это ?
Насчет птоков, в БМаксе есть потоки... помоему лучше поточный даунлоад организовать отдельно