Hi mike,
Bingo, it works now very well with the following code:
At App Start:
AddObject("MapBmp","BitmapEx")
MapBmp.New2(1,1)
AddObject("DrawerMapBmp","DrawerEx")
DrawerMapBmp.New1("FollowForm",False)
AddObject("RectSrc","RectangleEx")
AddObject("RectDes","RectangleEx")
RectSrc.New1(120*FixX,120*FixY,FixX*240,FixY*240)
RectDes.New1(0,0,240*FixX,240*FixY)
AddObject("MapRequest","WEBRequest")
AddObject("MapResponse","WEBResponse")
MapResponse.New1
Each time to read a map:
MapRequest.New1(URLStr)
MapRequest.TimeOut=30000
MapResponse.Value=MapRequest.GetResponse
If MapRequest.ResponseCode= 200 Then
MapBmp.Release
Reader.New1(MapResponse.GetStream,True) 'Use a BinaryFile object to read the data from the Response stream.
If FileExist(AppPath & "\MapFile.jpg") = True Then
FileDel(AppPath & "\MapFile.jpg")
End If
FileOpen(c1,AppPath & "\MapFile.jpg",cRandom)
Writer.New1(c1,False)
Dim buffer(4096) As byte
count = Reader.ReadBytes(buffer(),4096)
Do While count > 0
Writer.WriteBytes2(buffer(),0,count)
count = Reader.ReadBytes(buffer(),4096)
Loop
FileClose(c1)
MapBmp.Create1(AppPath & "\MapFile.jpg")
DisplayMap (0,0)
Sub DisplayMap(x,y)
RectSrc.New1(X,Y,240*FixX , 240*FixY ) DrawerMapBmp.Drawimage(MapBmp.Value,RectSrc.value,RectDes.value,False)
DrawerMapBmp.RefreshForm2("FollowForm",RectDes.value)
End Sub
Thanks for your help and suggestions.
Harry