1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question [XUI] Anomaly with B4XView

Discussion in 'Android Questions' started by Star-Dust, Apr 26, 2018.

  1. Star-Dust

    Star-Dust Expert Licensed User

    Today I have already asked a question about what seemed to me an anomaly, but I simply had not read XUI's help.
    I hope I'm not wrong yet.

    To perform graphics processing I assign a panel to a B4XView.
    Code:
    Dim BView As B4XView = PanelImage
    And I carry out the elaborations. See example.
    Code:
    Sub Button1_Click
        
    Dim BView As B4XView = PanelImage
        PanelResult.SetBackgroundImage(BView.Snapshot)
    End Sub
    If this sub I call it several times, it changes the position of the panel (Left and Top became 0). So I'm forced to save Left and Top to bring it back to its point of origin.
    See:
    Code:
    Sub Button1_Click
        
    Dim BView As B4XView = PanelImage
        
    Dim l As Int = PanelImage.Left
        
    Dim T As Int = PanelImage.Top
     
        PanelResult.SetBackgroundImage(BView.Snapshot)
     
        PanelImage.SetLayout(l,T,PanelImage.Width,PanelImage.Height)
    End Sub
    Why?
     
    Last edited: Apr 26, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    This is not the expected behavior. Can you upload a small project that demonstrates it?
     
  3. Star-Dust

    Star-Dust Expert Licensed User

    It happened to me several times, but I can attach the last code written to help someone on the forum.

    Present this problem, I attach it
    ezgif.com-gif-maker.gif
     

    Attached Files:

  4. OliverA

    OliverA Expert Licensed User

    It's the Snapshot method that seems to zero out top and left of the method's owner.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    It is indeed a bug in Snapshot. An updated version will be released next week.
     
    Johan Hormaza and Star-Dust like this.
  6. Star-Dust

    Star-Dust Expert Licensed User

  7. LucaMs

    LucaMs Expert Licensed User

    I don't think it is a bug; simply the horse has gone wild.
     
  8. Cableguy

    Cableguy Expert Licensed User

    It needs to be tammed, and that's a horse for @Erel!
     
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