@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}); } }
public KrollDict toImage() { return TiUIHelper.viewToImage(proxy.getProperties(), getNativeView()); }
@Override public KrollDict handleToImage() { return TiUIHelper.viewToImage( getTiContext(), this.properties, getTiContext().getActivity().getWindow().getDecorView()); }
public KrollDict toImage() { return TiUIHelper.viewToImage(proxy.getTiContext(), getNativeView()); }