Skip to content

Commit 7b05fb9

Browse files
committed
requestScreenshot docs
1 parent a6b9a65 commit 7b05fb9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ end, "blob")
143143

144144
## Screenshot Basic compatibility
145145

146-
### This is NOT recommended to use, as you risk exposing tokens to clients.
146+
147147

148148
### requestScreenshotUpload (client-side export)
149+
#### This is NOT recommended to use, as you risk exposing tokens to clients.
149150

150151
```lua
151152
exports['screencapture']:requestScreenshotUpload('https://api.fivemanage.com/api/image', 'file', {
@@ -160,6 +161,18 @@ exports['screencapture']:requestScreenshotUpload('https://api.fivemanage.com/api
160161
end)
161162
```
162163

164+
### requestScreenshot (client-side export)
165+
166+
This export returns a base64 data URI of the screenshot, similar to screenshot-basic. It does not upload the image, but provides the raw image data to your callback.
167+
168+
```lua
169+
exports['screencapture']:requestScreenshot({ encoding = 'jpg' }, function(data)
170+
-- 'data' is a base64-encoded image string (data URI)
171+
print(data)
172+
-- You can use the data URI directly in HTML or upload it manually
173+
end)
174+
```
175+
163176
## What will this include?
164177

165178
1. Server exports both for getting image data and uploading images/videos from the server

0 commit comments

Comments
 (0)