'Crea un immagine dell'oggetto passato in Download
Sub CreateObj_PNG(obj As B4XView,FileName As String)
Dim xView As B4XView = obj
Dim Bitmap1 As B4XBitmap = xView.Snapshot
Dim Out As OutputStream
Dim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
' 'se il file esiste lo cancello
' If File.Exists(rp.GetSafeDirDefaultExternal(""),FileName & ".png") = True Then
' File.Delete(rp.GetSafeDirDefaultExternal(""),FileName & ".png")
' End If
Out = File.OpenOutput(File.Combine(File.DirRootExternal,"Download"), FileName & ".png", False)
'Out = File.OpenOutput(rp.GetSafeDirDefaultExternal(""), FileName & ".png", False)
Bitmap1.WriteToStream(Out, 100, "PNG")
Out.Close
End Sub