Android Question SignatureCapture.Save... Problem

ST500

Active Member
Licensed User
Hi guys,

I need your help. Why doesn't this command overwrite the picture?

SignatureCapture.Save(SD1, File.DirDefaultExternal & "/SQLite/Fuhrbericht", "Fahrer_" & baustelleneu.result & ".png")

Each time I can see the picture, that I saved first time.

Martin
 

Star-Dust

Expert
Licensed User
Longtime User
Try rhis:

B4X:
File.Delete(File.DirDefaultExternal & "/SQLite/Fuhrbericht", "Fahrer_" & baustelleneu.result & ".png")
SignatureCapture.Save(SD1, File.DirDefaultExternal & "/SQLite/Fuhrbericht", "Fahrer_" & baustelleneu.result & ".png")
OR
B4X:
Dim Out As OutputStream
'    Dim SD1 As Bitmap
'     I suppose SD1 is bitmap - If is Canvas use SD.bitmap
   
    Out=File.OpenOutput(File.DirDefaultExternal & "/SQLite/Fuhrbericht", "Fahrer_" & baustelleneu.result & ".png",False)
    SD1.WriteToStream(Out,"PNG")
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
If Class Signature Capture by Erel... for second solution can use this

B4X:
Dim Out AsOutputStream 
Out=File.OpenOutput(File.DirDefaultExternal & "/SQLite/Fuhrbericht", "Fahrer_" & baustelleneu.result & ".png",False)
SD1.Canvas.Bitmap.WriteToStream(Out,"PNG")
 
Upvote 0

ST500

Active Member
Licensed User
Star-Dus,

it makes me crazy. I can see the first picture, only. After deleting via code too. If I delete the picture manually it works.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Probably why use File.DirDefaultExternal But it is not recommended.
Use File.DirRootExternal

When do I use the second method I suggested to you to make a error?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
;)
 
Upvote 0
Top