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