Skip to content

Commit c73ddff

Browse files
authored
Update README.md
1 parent 7b87e78 commit c73ddff

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@ import { saveImageToGallery } from 'react-native-img-buffer-save';
3232

3333
export default function App() {
3434
const saveImg = () => {
35-
const imgBytes = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); // some image;
36-
37-
saveImageToGallery(img); // Accepts Uint8Array
38-
// or
39-
saveImageToGallery(img.buffer); // Accepts ArrayBuffer
35+
// Example binary image data (replace with actual image bytes)
36+
const imageBytes = Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) // YOUR REAL IMAGE;
37+
38+
// This function saves the image directly to the device's gallery.
39+
// It accepts both Uint8Array and ArrayBuffer inputs.
40+
41+
// ✅ Option 1: Pass Uint8Array directly
42+
saveImageToGallery(imageBytes);
43+
44+
// ✅ Option 2: Pass ArrayBuffer directly
45+
saveImageToGallery(imageBytes.buffer);
4046
};
4147

4248
return (

0 commit comments

Comments
 (0)