Android Question [XUI] Anomaly with B4XView

Star-Dust

Expert
Licensed User
Longtime 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.
B4X:
Dim BView As B4XView = PanelImage
And I carry out the elaborations. See example.
B4X:
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:
B4X:
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:

Star-Dust

Expert
Licensed User
Longtime 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
 

Attachments

  • CropBitmpa.zip
    73 KB · Views: 319
Upvote 0

OliverA

Expert
Licensed User
Longtime User
It's the Snapshot method that seems to zero out top and left of the method's owner.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Thanks :)
 
Upvote 0
Top