Dim img As B4XBitmap=content
Dim imgPath As String=File.Combine(File.DirApp,"image.jpg")
Dim out As OutputStream=File.OpenOutput(imgPath,"",False)
img.WriteToStream(out,"100","JPEG")
out.Close
Dim ratio As Double=img.Width/img.Height
Dim width As Int=Min(img.Width,100)*9525
Dim height As Int=width/ratio
Dim bytes() As Byte
bytes=File.ReadBytes(File.DirApp,"image.jpg")
Dim data As InputStream
data.InitializeFromBytesArray(bytes,0,bytes.Length)
Dim para As JavaObject = Cell.RunMethodJO("addParagraph",Null)
Dim run As JavaObject
run=para.RunMethodJO("createRun",Null)
run.RunMethod("addPicture",Array(data,5,"image.jpg",width,height))
data.Close