B4J Question B4XTable and Snapshot problem

Discussion in 'B4J Questions' started by behnam_tr, Aug 8, 2019.

  1. behnam_tr

    behnam_tr Member

    hello

    i want to take snapshop from b4xtable
    but final image is null

    in designer i add b4xtable to pane
    and i load this layout with this code in b4j form

    Code:
    Dim p As Pane
        p.Initialize(
    "")
        p.LoadLayout(
    "myleyout")
        p.SetSize(
    750dip,900dip)
        p.Visible=
    true
        MainForm.RootPane.AddNode(p,
    0,0,750,900)
    after insert data to b4xtable i take snapshot with this code

    Code:
    Dim bmp As B4XBitmap = p.Snapshot
        
    Dim out As OutputStream
        out = 
    File.OpenOutput(File.DirApp&"/user_reports"DateTime.Now&".png"False)
        bmp.WriteToStream(out, 
    100"PNG")
        out.Close

    panel border and color is shown in image but b4xtable area is white
    even b4xtable border color is in the image but data is null and white color

    i do this with normal tableview and no problem
    thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Do you call it right after you add the data? If so then add Sleep(100) to allow the interface to be updated.
     
    behnam_tr likes this.
  3. behnam_tr

    behnam_tr Member

    yes problem solved with sleep
    thanks
     
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