public class ImageEditingManager extends NativeImageEditorSpec
NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
ImageEditingManager(ReactApplicationContext reactContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
cropImage(java.lang.String uri,
ReadableMap options,
Callback success,
Callback error)
Crop an image.
|
java.lang.String |
getName() |
void |
onCatalystInstanceDestroy()
Called before {CatalystInstance#onHostDestroy}
|
getCurrentActivity, getReactApplicationContext, getReactApplicationContextIfActiveOrWarncanOverrideExistingModule, getConstants, hasConstants, initialize, invalidateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvalidatepublic static final java.lang.String NAME
public ImageEditingManager(ReactApplicationContext reactContext)
public java.lang.String getName()
require() this module
from javascript.public void onCatalystInstanceDestroy()
NativeModuleonCatalystInstanceDestroy in interface NativeModuleonCatalystInstanceDestroy in class BaseJavaModulepublic void cropImage(java.lang.String uri,
ReadableMap options,
Callback success,
Callback error)
cropImage in class NativeImageEditorSpecuri - the MediaStore URI of the image to cropoptions - crop parameters specified as {offset: {x, y}, size: {width, height}}.
Optionally this also contains {targetSize: {width, height}}. If this is specified,
the cropped image will be resized to that size. All units are in pixels (not DPs).success - callback to be invoked when the image has been cropped; the only argument that
is passed to this callback is the file:// URI of the new imageerror - callback to be invoked when an error occurs (e.g. can't create file etc.)