Esempio 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});
    }
  }
Esempio 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());
 }
Esempio n. 4
0
 public KrollDict toImage() {
   return TiUIHelper.viewToImage(proxy.getTiContext(), getNativeView());
 }