You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| permissionDialogMessage |`string`| Android Only: Provide a Dialog Message for the Image Saving PermissionDialog. Defaults to empty string if not set |
102
102
| onGenerateBase64 |`function`| An optional function which accepts 1 argument `result` containing the base64 string of the canvas. Called when `getBase64()` is invoked. |
103
103
| onCanvasReady |`function`| An optional function called when the canvas is ready for interaction. |
104
-
| initialPaths |`array`| Array of paths to load into the canvas when it becomes ready. Uses native batch processing for optimal performance. Each path should follow the [Path object](#objects) format. |
105
-
| onInitialPathsLoaded |`function`| An optional function which accepts 1 argument `eventData`. Called when `initialPaths` have been processed and loaded into the canvas. `eventData` is an object with `{ loadedCount: number }` property containing the number of paths successfully loaded. |
104
+
| initialPaths |`array`| Array of paths to load into the canvas when it becomes ready. Uses native batch processing for optimal performance. Each path should follow the [Path object](#objects) format. |
105
+
| onInitialPathsLoaded |`function`| An optional function which accepts 1 argument `eventData`. Called when `initialPaths` have been processed and loaded into the canvas. `eventData` is an object with `{ loadedCount: number }` property containing the number of paths successfully loaded. |
| save(imageType, transparent, folder, filename, includeImage, cropToImageSize) | Save image to camera roll or filesystem. If `localSourceImage` is set and a background image is loaded successfully, set `includeImage` to true to include background image and set `cropToImageSize` to true to crop output image to background image.<br/>Android: Save image in `imageType` format with transparent background (if `transparent` sets to True) to **/sdcard/Pictures/`folder`/`filename`** (which is Environment.DIRECTORY_PICTURES).<br/>iOS: Save image in `imageType` format with transparent background (if `transparent` sets to True) to camera roll or file system. If `folder` and `filename` are set, image will save to **temporary directory/`folder`/`filename`** (which is NSTemporaryDirectory()) |
118
118
| getPaths() | Get the paths that drawn on the canvas |
119
119
| getBase64(imageType, transparent, includeImage, includeText, cropToImageSize) | Get the base64 string of the canvas. The result will be sent through the `onGenerateBase64` event handler. Parameters:<br/>- `imageType`: "png" or "jpg"<br/>- `transparent`: whether to include transparency<br/>- `includeImage`: whether to include background image<br/>- `includeText`: whether to include text<br/>- `cropToImageSize`: whether to crop to background image size |
120
-
| setInitialPaths(initialPaths) | Set initial paths to the canvas using native batch processing. This method is called automatically when the `initialPaths` prop is provided, but can also be called manually for dynamic path loading.|
120
+
| setInitialPaths(initialPaths) | Set initial paths to the canvas using native batch processing. This method is called automatically when the `initialPaths` prop is provided, but can also be called manually for dynamic path loading.|
| savePreference |`function`| A function which is called when saving image and should return an object (see [below](#objects)). |
262
262
| onSketchSaved |`function`| See [above](#properties)|
263
263
| onCanvasReady |`function`| An optional function called when the canvas is ready for interaction. |
264
-
| initialPaths |`array`| Array of paths to load into the canvas when it becomes ready. Uses native batch processing for optimal performance. Each path should follow the [Path object](#objects) format. |
265
-
| onInitialPathsLoaded |`function`| An optional function which accepts 1 argument `eventData`. Called when `initialPaths` have been processed and loaded into the canvas. `eventData` is an object with `{ loadedCount: number }` property containing the number of paths successfully loaded. |
264
+
| initialPaths |`array`| Array of paths to load into the canvas when it becomes ready. Uses native batch processing for optimal performance. Each path should follow the [Path object](#objects) format.|
265
+
| onInitialPathsLoaded |`function`| An optional function which accepts 1 argument `eventData`. Called when `initialPaths` have been processed and loaded into the canvas. `eventData` is an object with `{ loadedCount: number }` property containing the number of paths successfully loaded.|
To use an image as background, `localSourceImage`(see [below](#background-image)) reqires an object, which consists of `filename`, `directory`(optional) and `mode`(optional). <br/>
294
+
To use an image as background, `localSourceImage`(see [below](#background-image)) requires an object, which consists of `filename`, `directory`(optional) and `mode`(optional). <br/>
295
295
Note: Because native module cannot read the file in JS bundle, file path cannot be relative to JS side. For example, '../assets/image/image.png' will fail to load image.
296
296
297
297
### Typical Usage
@@ -323,7 +323,7 @@ Note: Because native module cannot read the file in JS bundle, file path cannot
323
323
324
324
---
325
325
326
-
The `initialPaths` prop allows you to pre-load paths into the canvas when it becomes ready. This feature uses native batch processing for optimal performance, making it ideal for loading saved sketches or collaborative drawing sessions.
326
+
The `initialPaths` prop allows you to preload paths into the canvas when it becomes ready. This feature uses native batch processing for optimal performance, making it ideal for loading saved sketches or collaborative drawing sessions.
327
327
328
328
### Usage
329
329
@@ -368,27 +368,14 @@ export default function Example() {
368
368
}
369
369
```
370
370
371
-
### Performance Benefits
372
-
373
-
-**Batch Processing**: Paths are loaded in a single native operation instead of individual calls
0 commit comments