Android Question output stream multiple

Sofian

Member
Hi, I want to ask about WritetoStream multiple imageview. I have 2 image on 2 imageview and 2 sub for stream to file
stream sub:
Sub loadktp(namafl As String)
    Dim kt As Bitmap
    kt.Initialize(File.DirAssets,"back2.jpg")
    kt = imgKTP.Bitmap
    Dim out As OutputStream
    out = File.OpenOutput(LokasiImg, "A.jpg", False)
    kt.WriteToStream(out, 60, "JPEG")
    out.Close
End Sub

Sub loadselfie(namafl As String)
    Dim sf As Bitmap
    sf.Initialize(File.DirAssets,"back2.jpg")
    sf = imgSelfie.Bitmap
    Dim out1 As OutputStream
    out1 = File.OpenOutput(LokasiImg, "B.jpg", False)
    sf.WriteToStream(out1, 60, "JPEG")
    out1.Close
End Sub
I want to create it to file for upload.
if i call each sub form different button (sample) button1 click -> callsub : loadktp and button2 click -> callsub : loadselfie , it can stream each image to A.jpg and B.jpg file.
My problem is when I call all sub from button3 -> callsub loadktp and callsub loadselfie, I only got B.jpg and .jpg (without A) and it damage pict.

Please help. Thanks
 

Sofian

Member
I take 2 picture from camera, it save to file with same filename : 1.jpg after take a picture, I load to imageview1 and then take another picture and load to imageview2.
After that I want to upload that imageview with new filename, sample : A.jpg and B.jpg
If I upload it one by one, it can. but if I upload it all, only B.jpg and .jpg which .jpg is broken image.
Button1,2,3 is to test upload that imageview
Button1 : upload imageview1
Button2 : upload imageview2
Button3 : upload imageview1 & 2 (that I need is this)
 
Upvote 0

Similar Threads

Top