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, getReactApplicationContextIfActiveOrWarn
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invalidate
public static final java.lang.String NAME
public ImageEditingManager(ReactApplicationContext reactContext)
public java.lang.String getName()
require()
this module
from javascript.public void onCatalystInstanceDestroy()
NativeModule
onCatalystInstanceDestroy
in interface NativeModule
onCatalystInstanceDestroy
in class BaseJavaModule
public void cropImage(java.lang.String uri, ReadableMap options, Callback success, Callback error)
cropImage
in class NativeImageEditorSpec
uri
- 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.)