Android Question Taking a screenshot of whole (scrollable) panel.

Discussion in 'Android Questions' started by Kapelis, Feb 3, 2015.

  1. Kapelis

    Kapelis Member Licensed User

    Hi, I'm trying to make a screenshot of my app, I have followed the example in the beginners guide and it all works well. I modified the code to get a screenshot of the whole panel but the photo is "cropped" at some point and the rest (bottom) of the picture is black. Can anyone help? thank you very much.
    Sub btnShare_Click
    ' Take a screenshot.
      Dim Obj1, Obj2 As Reflector
    Dim bmp As Bitmap
    Dim C As Canvas
      Obj1.Target = Obj1.GetActivityBA
      Obj1.Target = Obj1.GetField(
    'bmp.InitializeMutable(Activity.Width, Activity.Height)
      bmp.InitializeMutable(Panel1.Width, Panel1.Height)
    Dim args(1As Object
    Dim types(1As String
      Obj2.Target = C
      Obj2.Target = Obj2.GetField(
    0) = Obj2.Target
    0) = ""
    "draw", args, types)
    Dim Out As OutputStream
      Out = 
    File.OpenOutput(File.DirRootExternal, "Aldrete score" & ".png"False)
    End Sub
  2. Erel

    Erel Administrator Staff Member Licensed User

    You are still drawing the activity.
    Try to change to Obj1.Target = Panel1 (I assume that Panel1 is the ScrollView inner panel).
    Kapelis likes this.
  3. Kapelis

    Kapelis Member Licensed User

    Works perfectly, thank you very much!
  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