iOS Question B4i Save Imageview as Jpeg

james_sgp

Active Member
Licensed User
Hi, I`ve created a QR code in an imageview and I want to save it to 'xui.defaultfolder' so i can use it in a PDF document. My code works on B4a but its not working on B4i, any idea`s what I`m doing wrong?

B4X:
    #if b4a
        qr.Initialize(view_pdf_qr.width)
        view_pdf_qr.SetBitmap(qr.Create(main_page.strURL & "uploads/" & main_page.strSupportFile & ".pdf"))
        Dim out As OutputStream = File.OpenOutput(xui.DefaultFolder, "qr_code.jpeg", False)
        view_pdf_qr.Snapshot.WriteToStream(out,80,"JPEG")
        out.Close
    #else if b4i
        Dim bmp1 As B4XBitmap = view_pdf_qr.Snapshot
        Dim Out As OutputStream
        Out = File.OpenOutput(xui.DefaultFolder,"qr_code.jpeg", False)
        bmp1.WriteToStream(Out, 80, "JPEG")
        Out.Close
    #end if
 
Top