Skip to main content

Platform differences

The API and the documented behavior are the same on both platforms. The native paths differ:

AspectiOS (Swift)Android (Kotlin)
DrawingUIView.drawHierarchy(in:afterScreenUpdates: true) into a UIGraphicsImageRendererView.draw on a hardware canvas backed by an ImageReader surface
ThreadsDraws on the main (JavaScript) thread; the promise is settled before capture returnsDraws on the main thread; copies pixels into a Bitmap on a background NitroViewShot thread
Views not in a windowFalls back to CALayer.render(in:)Same path as attached views
Rounded clippingThe view's own clipping appliesRe-applies the view's outline clip; outlines with a different radius per corner are left unclipped
Native pixel buffer8-bit sRGB (preferredRange = .standard), scale 1 so sizes are pixelsARGB_8888 Bitmap
Raw pixel pixelFormatTypically '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.