Ejemplo n.º 1
0
  @Kroll.method
  public void takeScreenshot(KrollFunction callback) {
    Activity a = TiApplication.getAppCurrentActivity();

    if (a == null) {
      Log.w(TAG, "Could not get current activity for takeScreenshot.", Log.DEBUG_MODE);
      callback.callAsync(getKrollObject(), new Object[] {null});
      return;
    }

    while (a.getParent() != null) {
      a = a.getParent();
    }

    Window w = a.getWindow();

    while (w.getContainer() != null) {
      w = w.getContainer();
    }

    KrollDict image = TiUIHelper.viewToImage(null, w.getDecorView());
    if (callback != null) {
      callback.callAsync(getKrollObject(), new Object[] {image});
    }
  }
Ejemplo n.º 2
0
 public KrollDict toImage() {
   return TiUIHelper.viewToImage(proxy.getProperties(), getNativeView());
 }
 @Override
 public KrollDict handleToImage() {
   return TiUIHelper.viewToImage(
       getTiContext(), this.properties, getTiContext().getActivity().getWindow().getDecorView());
 }
Ejemplo n.º 4
0
 public KrollDict toImage() {
   return TiUIHelper.viewToImage(proxy.getTiContext(), getNativeView());
 }