route-graphics 1.46.0 → 1.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/RouteGraphics.js +94 -94
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,6 +102,20 @@ Use `renderComplete` when playback completion is required. The PNG CLI waits
|
|
|
102
102
|
for scene readiness before applying `--time`; `--wait-for-render-complete`
|
|
103
103
|
retains its separate playback-completion meaning.
|
|
104
104
|
|
|
105
|
+
`extractBase64()` encodes the frame as a PNG data URL. To scale or re-encode
|
|
106
|
+
the frame instead, such as for a thumbnail, take the same pixels as a canvas
|
|
107
|
+
and skip encoding and decoding a full-size PNG:
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
const frame = await app.extractCanvas();
|
|
111
|
+
const thumbnail = document.createElement("canvas");
|
|
112
|
+
thumbnail.width = 400;
|
|
113
|
+
thumbnail.height = 225;
|
|
114
|
+
thumbnail.getContext("2d").drawImage(frame, 0, 0, 400, 225);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Both take an optional element label to extract that element alone.
|
|
118
|
+
|
|
105
119
|
Assets loaded by an app instance can be released after no rendered or
|
|
106
120
|
transitioning element still references them:
|
|
107
121
|
|