Sub DownloadAndUploadImage(DownloadLink As String,Uploadlink As String, iv As ImageView)
Dim j As HttpJob
j.Initialize("", Me)
j.Download(DownloadLink)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
UploadImage(j.GetBitmap,Uploadlink)
iv.Bitmap = j.GetBitmap
End If
j.Release
End Sub
Sub UploadImage(Bitmap As Bitmap, UploadUrl As String)
Dim jj As HttpJob
jj.Initialize("", Me)
Dim OutputStream As OutputStream
OutputStream.InitializeToBytesArray(100)
Bitmap.WriteToStream(OutputStream, 100, "JPEG")
Dim ByteArray() As Byte = OutputStream.ToBytesArray
jj.PostBytes(UploadUrl, ByteArray)
Wait For (jj) JobDone(jj As HttpJob)
If jj.Success Then
Log("upload ok" )
Else
Log("upload error: " & jj.ErrorMessage)
End If
jj.Release
End Sub