Platform differences
The API and the documented behavior are the same on both platforms. The native paths differ:
| Aspect | iOS (Swift) | Android (Kotlin) |
|---|---|---|
| Drawing | UIView.drawHierarchy(in:afterScreenUpdates: true) into a UIGraphicsImageRenderer | View.draw on a hardware canvas backed by an ImageReader surface |
| Threads | Draws on the main (JavaScript) thread; the promise is settled before capture returns | Draws on the main thread; copies pixels into a Bitmap on a background NitroViewShot thread |
| Views not in a window | Falls back to CALayer.render(in:) | Same path as attached views |
| Rounded clipping | The view's own clipping applies | Re-applies the view's outline clip; outlines with a different radius per corner are left unclipped |
| Native pixel buffer | 8-bit sRGB (preferredRange = .standard), scale 1 so sizes are pixels | ARGB_8888 Bitmap |
Raw pixel pixelFormat | Typically 'BGRA' | Typically 'RGBA' |
Rounded corners on Android
View.draw(canvas) bypasses the view's own RenderNode, so the library re-applies the outline clip that node would apply. A uniform corner radius is clipped. A rounded outline with different radii per corner is a path outline, which Android only reads back from API 33, so the library leaves it unclipped: children can spill past those corners in the image.
Shadows on Android
The capture draws on a hardware canvas. NitroUI shadows throw on software canvases, so this path is what lets views with a boxShadow be captured. A native test covers it on devices where Application.supportsShadows is true.