Android Question how to readfrom stream and return bmp round image

Makumbi

Well-Known Member
Licensed User
this codes save the image very well but my biggest problem is returning what has been saved in the stream to round bmp please help

More also i would want to save these files with account Numbers so that the app first checks if a particular image files exists then read it else it should create it thanks in advance

B4X:
Sub SavePhoto (Pt As Bitmap,NewFile As String)
    Dim Out As OutputStream
    Out = File.OpenOutput(File.DirInternal, NewFile, False)
    Pt.WriteToStream(Out, 100, "PNG")
    
    Out.Close
End Sub

below is the code i wanted to read the stream and then return the image as a round image
B4X:
                            Dim InputStream1 As InputStream
                            InputStream1 = File.OpenInput(File.DirInternal, "Test.png")
                            Dim OutputStream1 As OutputStream
                            OutputStream1.InitializeToBytesArray(1000)
                            File.Copy2(InputStream1, OutputStream1)
 

Brandsum

Well-Known Member
Licensed User
Why do you want to use input stream when you have that bitmap in Pt variable. After saving just use that bitmap to create a rounded one and use as you want.
 
Upvote 0
Top