gre / react-native-view-shot

Snapshot a React Native view and save it to an image
https://github.com/gre/react-native-view-shot-example
MIT License
2.64k stars 344 forks source link

how to avoid black edges formed after capturing. #526

Closed chaitanya71998 closed 1 month ago

chaitanya71998 commented 4 months ago

Issue

getting black edges on the sides after capturing a view and sharing it. Version: Platform: IOS & Android

Expected behavior:

Need a image without black edges on horizontal sides

Actual behavior:

Getting black edges on left and right

image

Steps to reproduce the behavior

chaitanya71998 commented 4 months ago

the captureRef is giving an image of size 1080x1355 and when i share it in any app its coming with black edges

Mashirowww commented 2 months ago

I also encountered this problem seems to have to manually cut by myself

chaitanya71998 commented 1 month ago

This issue has been resolved. I captured the image and rendered it to fit the screen width using another image element (with width set to screen width). Then, I used the view shot to capture this newly rendered image, which now has the device's screen width that has no black edges