iOS Question Capture Panel to imageview and Share

Discussion in 'iOS Questions' started by Kope, May 11, 2019.

  1. Kope

    Kope Member Licensed User

  2. klaus

    klaus Expert Licensed User

    You should use the iXUI library.
    Declare both views as B4XView.
    Private MyImageView, MyPanel As B4XView
    Then use:
    MyImageView.SetBitmap(MyPanel.Snapshot)

    Tested with B4J, but it should work with B4i and B4A.
     
  3. Kope

    Kope Member Licensed User

    Thank @klaus it works but the image got distorted after Clicking Save Button and please, how do i save and share on other platforms
     

    Attached Files:

  4. klaus

    klaus Expert Licensed User

    Snapshot returns a B4XBitmap.
    With B4XBitmap.WriteToStream you can save it in a file.
    Then, I have no experiene in sharing files between iOS and other platforms.
    For the image distortion I suppose that the width / height ratio is not the same.
     
    Kope likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. Kope

    Kope Member Licensed User

    Thanks so much for the help but a little help on how to save

    I have
    Code:
    Private MyImageView, MyPanel As B4XView

    Sub Save_Click
        MyImageView.SetBitmap(MyPanel.Snapshot)
        
    Dim bmp As B4XBitmap = Panel5.Snapshot
        
    Dim Out As OutputStream
        Out = 
    File.OpenOutput(File.DirDocuments,"1.jpeg"False)
        bmp.WriteToStream(Out, 
    100"JPEG")
        Out.Close
    End Sub
    i still can't save the images let alone to share

    please help me out with example

    thanks
     
    Last edited: May 14, 2019
  7. klaus

    klaus Expert Licensed User

    I already told you:
    I have no experiene in sharing files between iOS and other platforms.
    I would have to do the same as you could do: serch in the forum.
    Erel gave you a link in post #5
     
  8. Kope

    Kope Member Licensed User

    Noted Klaus

    Kindly help me out with how to save using b4xBitmap.writetostream. I have tried but could not get it working #6
    Thank You
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Your code correctly saves the bitmap. What is the problem?
     
  10. Kope

    Kope Member Licensed User

    Have sorted it out

    the problem was with the Arrangement of the views in the Designer.

    Thanks @Erel and @klaus
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice